sys.last_traceback

sys.last_traceback These three variables are not always defined; they are set when an exception is not handled and the interpreter prints an error message and a stack traceback. Their intended use is to allow an interactive user to import a debugger module and engage in post-mortem debugging without having to re-execute the command that caused the error. (Typical use is import pdb; pdb.pm() to enter the post-mortem debugger; see pdb module for more information.) The meaning of the variables

sys.last_type

sys.last_type sys.last_value sys.last_traceback These three variables are not always defined; they are set when an exception is not handled and the interpreter prints an error message and a stack traceback. Their intended use is to allow an interactive user to import a debugger module and engage in post-mortem debugging without having to re-execute the command that caused the error. (Typical use is import pdb; pdb.pm() to enter the post-mortem debugger; see pdb module for more information.) T

sys.maxsize

sys.maxsize An integer giving the maximum value a variable of type Py_ssize_t can take. It’s usually 2**31 - 1 on a 32-bit platform and 2**63 - 1 on a 64-bit platform.

sys.last_value

sys.last_value sys.last_traceback These three variables are not always defined; they are set when an exception is not handled and the interpreter prints an error message and a stack traceback. Their intended use is to allow an interactive user to import a debugger module and engage in post-mortem debugging without having to re-execute the command that caused the error. (Typical use is import pdb; pdb.pm() to enter the post-mortem debugger; see pdb module for more information.) The meaning of

sys.is_finalizing()

sys.is_finalizing() Return True if the Python interpreter is shutting down, False otherwise. New in version 3.5.

sys.intern()

sys.intern(string) Enter string in the table of “interned” strings and return the interned string – which is string itself or a copy. Interning strings is useful to gain a little performance on dictionary lookup – if the keys in a dictionary are interned, and the lookup key is interned, the key comparisons (after hashing) can be done by a pointer compare instead of a string compare. Normally, the names used in Python programs are automatically interned, and the dictionaries used to hold modu

sys.int_info

sys.int_info A struct sequence that holds information about Python’s internal representation of integers. The attributes are read only. Attribute Explanation bits_per_digit number of bits held in each digit. Python integers are stored internally in base 2**int_info.bits_per_digit sizeof_digit size in bytes of the C type used to represent a digit New in version 3.1.

sys.hexversion

sys.hexversion The version number encoded as a single integer. This is guaranteed to increase with each version, including proper support for non-production releases. For example, to test that the Python interpreter is at least version 1.5.2, use: if sys.hexversion >= 0x010502F0: # use some advanced feature ... else: # use an alternative implementation or warn the user ... This is called hexversion since it only really looks meaningful when viewed as the result of passing

sys.hash_info

sys.hash_info A struct sequence giving parameters of the numeric hash implementation. For more details about hashing of numeric types, see Hashing of numeric types. attribute explanation width width in bits used for hash values modulus prime modulus P used for numeric hash scheme inf hash value returned for a positive infinity nan hash value returned for a nan imag multiplier used for the imaginary part of a complex number algorithm name of the algorithm for hashing of str, bytes, and memory

sys.implementation

sys.implementation An object containing information about the implementation of the currently running Python interpreter. The following attributes are required to exist in all Python implementations. name is the implementation’s identifier, e.g. 'cpython'. The actual string is defined by the Python implementation, but it is guaranteed to be lower case. version is a named tuple, in the same format as sys.version_info. It represents the version of the Python implementation. This has a distinct