simvx.core.diagnostics

The warning category for mistakes in game code that the engine can see.

Checks that catch such a mistake run only while Node.dev_warnings is on, and report through :mod:warnings under :class:DevWarning, so a developer can filter them like any other warning::

import warnings
from simvx.core import DevWarning

warnings.simplefilter("error", DevWarning)    # fail fast in a test run
warnings.simplefilter("ignore", DevWarning)   # or silence them

Module Contents

Functions

warn_dev

Issue message as a :class:DevWarning, attributed to the calling game code.

Data

API

simvx.core.diagnostics.__all__

[‘DevWarning’, ‘warn_dev’]

exception simvx.core.diagnostics.DevWarning[source]

Bases: UserWarning

A mistake in game code that the engine noticed while Node.dev_warnings is on.

Each check reports a given mistake once, naming what is wrong and the fix.

Initialization

Initialize self. See help(type(self)) for accurate signature.

class __cause__
class __context__
__delattr__()
__dir__()
__eq__()
__format__()
__ge__()
__getattribute__()
__getstate__()
__gt__()
__hash__()
__le__()
__lt__()
__ne__()
__new__()
__reduce__()
__reduce_ex__()
__repr__()
__setattr__()
__setstate__()
__sizeof__()
__str__()
__subclasshook__()
class __suppress_context__
class __traceback__
add_note()
class args
with_traceback()
simvx.core.diagnostics.warn_dev(message: str) → None[source]

Issue message as a :class:DevWarning, attributed to the calling game code.

The caller decides once-ness and guards the call on Node.dev_warnings.