API

Debugging print features.

class show.core.NoShow(**kwargs)

A Show variant that shows nothing. Maintains just enough context to respond as a real Show would. Any clones will also be ``NoShow``s–again, to retain similarity. Designed to squelch all output in efficient way, but not requiring any changes to the source code. Maintains just enough context to

blank_lines(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

changed(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

clone(**kwargs)

Create a child instance whose options are chained to this instance’s options (and thence to Show.options). kwargs become the child instance’s overlay options. Because of how the source code is parsed, clones must be named via simple assignment.

dir(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

hr(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

inout(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

items(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

locals(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

props(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

retval(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

title(*args, **kwargs)

Fake entry point. Does nothing, returns immediately.

class show.core.Show(**kwargs)

Show objects print debug output in a ‘name: value’ format that is convenient for discovering what’s going on as a program runs.

arg_format(name, value, caller, opts)

Format a single argument. Strings returned formatted.

arg_format_dir(name, value, caller, opts)

Format a single argument to show items of a collection.

arg_format_items(name, value, caller, opts)

Format a single argument to show items of a collection.

arg_format_props(name, value, caller, opts, ignore_funky=True)

Format a single argument to show properties.

call_location(caller)

Create a call location string indicating where a show() was called.

changed(*args, **kwargs)

Show the local variables, then again only when changed.

clone(**kwargs)

Create a child instance whose options are chained to this instance’s options (and thence to Show.options). kwargs become the child instance’s overlay options. Because of how the source code is parsed, clones must be named via simple assignment.

code_repr(code)

Return a formatted string for code. If there are any internal brace characters, they are doubled so that they are not interpreted as format template characters when the composed string is eventually output by say.

dir(*args, **kwargs)

Show the attributes possible for the given object(s)

get_arg_tuples(caller, values)

Return a list of argument (name, value) tuples. :caller: The calling frame. :values: The with the given values.

inout(*dargs, **dkwargs)

Show arguments to a function. Decorator itself may take arguments, or not. Whavevs.

items(*args, **kwargs)

Show items of a collection.

locals(*args, **kwargs)

Show all local vars, plus any other values mentioned.

method_push(base_options, method_name, kwargs)

Transitional helper function to simplify the grabbing of method-specific arguments. Will be phased out as the learnings about method arguments are piped back into Options and a more long-term API is completed.

pprint(*args, **kwargs)

Show the objects as displayed by pprint. Not well integrated as yet. Just a start.

prettyprint(mode='ansi', sep=' ', indent=4, width=120, depth=5, style='friendly')

Convenience method to turn on pretty-printing. Mode can be text or ansi.

props(*args, **kwargs)

Show properties of objects.

retval(func)

Decorator that shows arguments to a function, and return value, once the function is complete. Similar to inout, but only displays once function has returned.

set(**kwargs)

Change the values of the show.

value_repr(value)

Return a repr() string for value that has any brace characters (e.g. for dict–and in Python 3, set`--literals) doubled so that they are not interpreted as format template characters when the composed string is eventually output by ``say.

where(*args, **kwargs)

Show where program execution currently is. Can be used with normal output, but generally is intended as a marker.