sys.setprofile(profilefunc) Set the system’s profile function, which allows you to implement a Python source code profiler in
format(*, chain=True) Format the exception. If chain is not True, __cause__
gc.get_objects() Returns a list of all objects tracked by the collector, excluding the list returned.
callback(callback, *args, **kwds) Accepts an arbitrary callback function and arguments and adds it to the callback stack.
traceback.format_exc(limit=None, chain=True) This is like print_exc(limit) but returns a string instead of printing
sys.path A list of strings that specifies the search path for modules. Initialized from the environment variable PYTHONPATH
sys.ps2 Strings specifying the primary and secondary prompt of the interpreter. These are only defined if the interpreter is
sys.modules This is a dictionary that maps module names to modules which have already been loaded. This can be manipulated to
inspect.getcomments(object) Return in a single string any lines of comments immediately preceding the object’s source code (for
sys.setrecursionlimit(limit) Set the maximum depth of the Python interpreter stack to limit. This limit prevents infinite
Page 9 of 26