dbg
Module Contents
Classes
Create a collection of name/value pairs. |
|
Convert a string or number to a floating point number, if possible. |
Functions
|
|
|
|
|
|
|
A decorator that uses cProfile to profile a function |
|
|
|
Prints text to terminal for debugging. |
|
Updates the colourised string of the terminal with debug_print. If end is True the line is ended |
Attributes
- class dbg.MemSizeType(*args, **kwds)[source]
Bases:
enum.EnumCreate a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- class dbg.MemSize(value: int | float, size_type: str | MemSizeType = MemSizeType.megabyte)[source]
Bases:
floatConvert a string or number to a floating point number, if possible.
- static size_type_2_str(size_type: MemSizeType)[source]
- dbg.get_size(test_obj: object, size_type: str | MemSizeType = MemSizeType.megabyte)[source]
- dbg.explore_sizes(test_obj: object, size_type: str | MemSizeType = MemSizeType.megabyte, max_level=5, min_size_mb=None, stop_on_max_level=True, exclusion_types=None, exclusion_modules=None, only_show_new=False, __current_level=0, __objs_tested=None)[source]
- dbg.print_size(test_obj: object, size_type: str | MemSizeType = MemSizeType.megabyte)[source]
- dbg.u(debug_print: str, debug_from: str = None, end: bool = False)[source]
- Updates the colourised string of the terminal with debug_print. If end is True the line is ended
- debug_print: str
Test to be used updated the terminal with.
- debug_from: str, optional
To specify where debug text is being called from.
- end: str, optional
If true the line is ended.