Cope 2.5.0
My personal "standard library" of all the generally useful code I've written for various projects over the years
Loading...
Searching...
No Matches

◆ __call__()

"var" Cope.debugging.Debug.__call__ (   self,
  var = undefined,
str  name = None,
  color = ...,
bool  inspect = False,
bool  repr = True,
bool  trace = False,
bool  throw = False,
int  calls = 1,
bool  active = True,
  clr = ... 
)

Print variable names and values for easy debugging.

       Usage:
           debug()          -> Prints a standard message to just tell you that it's getting called
           debug('msg')     -> Prints the string along with metadata
           debug(var)       -> Prints the variable name, type, and value
           foo = debug(bar) -> Prints the variable name, type, and value, and returns the variable
           @debug           -> Use as a decorator to make note of when the function is called

       Args:
           var: The variable or variables to print
           name: Manully specify the name of the variable
           color/clr: Literally anything that specifies a color, including a single number for unique colors
           inspect: Calls rich.inspect on var
           repr: Uses repr by default, set to False to use str instead
           trace: Prints a neat stack trace of the current call
           calls: If you're passing in a return from a function, say calls=2
           active: Conditionally disables the function

Definition at line 438 of file debugging.py.