dataclasses API Reference
Full documentation for dataclasses (Standard Library / Native)
dataclasses.Field
Python Library Documentation: class Field in module dataclasses class Field(builtins.object) | Field(default, default_factory, init, repr, hash, compare, metadata, kw_only) | | # Instances of Field are only ever created from within this module, | # and only from the field() function, although Field instances are | # exposed externally as (conceptually) read-only objects. | # | # name and type are filled in after the fact, not in __init__. | # They're not known at the time this class is instantiated, but it's | # convenient if they're available later. | # | # When cls._FIELDS is filled in with a list of Field objects, the name | # and type fields will have been populated. | | Methods defined here: | | __init__(self, default, default_factory, init, repr, hash, compare, metadata, kw_only) | Initialize self. See help(type(self)) for accurate signature. | | __repr__(self) | Return repr(self). | | __set_name__(self, owner, name) | # This is used to support the PEP 487 __set_name__ protocol in the | # case where we're using a field that contains a descriptor as a | # default value. For details on __set_name__, see | # https://peps.python.org/pep-0487/#implementation-details. | # | # Note that in _process_class, this Field object is overwritten | # with the default value, so the end result is a descriptor that | # had __set_name__ called on it at the right time. | | ---------------------------------------------------------------------- | Class methods defined here: | | __class_getitem__ = GenericAlias(...) | Represent a PEP 585 generic type | | E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,). | | ---------------------------------------------------------------------- | Data descriptors defined here: | | compare | | default | | default_factory | | hash | | init | | kw_only | | metadata | | name | | repr | | type
dataclasses.FrozenInstanceError
Python Library Documentation: class FrozenInstanceError in module dataclasses class FrozenInstanceError(builtins.AttributeError) | # Raised when an attempt is made to modify a frozen class. | | Method resolution order: | FrozenInstanceError | builtins.AttributeError | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors defined here: | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from builtins.AttributeError: | | __getstate__(...) | Helper for pickle. | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | __reduce__(...) | Helper for pickle. | | __str__(self, /) | Return str(self). | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.AttributeError: | | name | attribute name | | obj | object | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) class method of builtins.Exception | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __getattribute__(self, name, /) | Return getattr(self, name). | | __repr__(self, /) | Return repr(self). | | __setstate__(...) | | add_note(...) | Exception.add_note(note) -- | add a note to the exception | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args
dataclasses.FunctionType
Python Library Documentation: class function in module builtins class function(object) | function(code, globals, name=None, argdefs=None, closure=None) | | Create a function object. | | code | a code object | globals | the globals dictionary | name | a string that overrides the name from the code object | argdefs | a tuple that specifies the default argument values | closure | a tuple that supplies the bindings for free variables | | Methods defined here: | | __call__(self, /, *args, **kwargs) | Call self as a function. | | __get__(self, instance, owner=None, /) | Return an attribute of instance, which is of type owner. | | __repr__(self, /) | Return repr(self). | | ---------------------------------------------------------------------- | Static methods defined here: | | __new__(*args, **kwargs) | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __annotations__ | | __closure__ | | __code__ | | __defaults__ | | __dict__ | | __globals__ | | __kwdefaults__ | | __type_params__
dataclasses.GenericAlias
Python Library Documentation: class GenericAlias in module types class GenericAlias(builtins.object) | Represent a PEP 585 generic type | | E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,). | | Methods defined here: | | __call__(self, /, *args, **kwargs) | Call self as a function. | | __dir__(...) | Default dir() implementation. | | __eq__(self, value, /) | Return self==value. | | __ge__(self, value, /) | Return self>=value. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __getitem__(self, key, /) | Return self[key]. | | __gt__(self, value, /) | Return self>value. | | __hash__(self, /) | Return hash(self). | | __instancecheck__(...) | Check if an object is an instance. | | __iter__(self, /) | Implement iter(self). | | __le__(self, value, /) | Return self<=value. | | __lt__(self, value, /) | Return self<value. | | __mro_entries__(...) | | __ne__(self, value, /) | Return self!=value. | | __or__(self, value, /) | Return self|value. | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __ror__(self, value, /) | Return value|self. | | __subclasscheck__(...) | Check if a class is a subclass. | | ---------------------------------------------------------------------- | Static methods defined here: | | __new__(*args, **kwargs) | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __args__ | | __origin__ | | __parameters__ | Type variables in the GenericAlias. | | __typing_unpacked_tuple_args__ | | __unpacked__
dataclasses.InitVar
Python Library Documentation: class InitVar in module dataclasses class InitVar(builtins.object) | InitVar(type) | | Methods defined here: | | __init__(self, type) | Initialize self. See help(type(self)) for accurate signature. | | __repr__(self) | Return repr(self). | | ---------------------------------------------------------------------- | Class methods defined here: | | __class_getitem__(type) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | type
dataclasses.KW_ONLY
Python Library Documentation: _KW_ONLY_TYPE in module dataclasses object class _KW_ONLY_TYPE(builtins.object) | # A sentinel object to indicate that following fields are keyword-only by | # default. Use a class to give it a better repr. | | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
dataclasses.MISSING
Python Library Documentation: _MISSING_TYPE in module dataclasses object class _MISSING_TYPE(builtins.object) | # A sentinel object to detect if a parameter is supplied or not. Use | # a class to give it a better repr. | | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
dataclasses.abc
Python Library Documentation: module abc
NAME
abc - Abstract Base Classes (ABCs) according to PEP 3119.
MODULE REFERENCE
https://docs.python.org/3.12/library/abc.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
CLASSES
builtins.classmethod(builtins.object)
abstractclassmethod
builtins.object
ABC
builtins.property(builtins.object)
abstractproperty
builtins.staticmethod(builtins.object)
abstractstaticmethod
builtins.type(builtins.object)
ABCMeta
class ABC(builtins.object)
| Helper class that provides a standard way to create an ABC using
| inheritance.
|
| Data and other attributes defined here:
|
| __abstractmethods__ = frozenset()
class ABCMeta(builtins.type)
| ABCMeta(name, bases, namespace, /, **kwargs)
|
| Metaclass for defining Abstract Base Classes (ABCs).
|
| Use this metaclass to create an ABC. An ABC can be subclassed
| directly, and then acts as a mix-in class. You can also register
| unrelated concrete classes (even built-in classes) and unrelated
| ABCs as 'virtual subclasses' -- these and their descendants will
| be considered subclasses of the registering ABC by the built-in
| issubclass() function, but the registering ABC won't show up in
| their MRO (Method Resolution Order) nor will method
| implementations defined by the registering ABC be callable (not
| even via super()).
|
| Method resolution order:
| ABCMeta
| builtins.type
| builtins.object
|
| Methods defined here:
|
| __instancecheck__(cls, instance)
| Override for isinstance(instance, cls).
|
| __subclasscheck__(cls, subclass)
| Override for issubclass(subclass, cls).
|
| register(cls, subclass)
| Register a virtual subclass of an ABC.
|
| Returns the subclass, to allow usage as a class decorator.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(mcls, name, bases, namespace, /, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __annotations__ = {}
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.type:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __dir__(self, /)
| Specialized __dir__ implementation for types.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __or__(self, value, /)
| Return self|value.
|
| __repr__(self, /)
| Return repr(self).
|
| __ror__(self, value, /)
| Return value|self.
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __sizeof__(self, /)
| Return memory consumption of the type object.
|
| __subclasses__(self, /)
| Return a list of immediate subclasses.
|
| mro(self, /)
| Return a type's method resolution order.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.type:
|
| __prepare__(...)
| __prepare__() -> dict
| used to create the namespace for the class statement
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.type:
|
| __abstractmethods__
|
| __dict__
|
| __text_signature__
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from builtins.type:
|
| __base__ = <class 'type'>
| type(object) -> the object's type
| type(name, bases, dict, **kwds) -> a new type
|
|
| __bases__ = (<class 'type'>,)
|
| __basicsize__ = 920
|
| __dictoffset__ = 264
|
| __flags__ = 2156420608
|
| __itemsize__ = 40
|
| __mro__ = (<class 'abc.ABCMeta'>, <class 'type'>, <class 'object'>)
|
| __type_params__ = ()
|
| __weakrefoffset__ = 368
class abstractclassmethod(builtins.classmethod)
| abstractclassmethod(callable)
|
| A decorator indicating abstract classmethods.
|
| Deprecated, use 'classmethod' with 'abstractmethod' instead:
|
| class C(ABC):
| @classmethod
| @abstractmethod
| def my_abstract_classmethod(cls, ...):
| ...
|
| Method resolution order:
| abstractclassmethod
| builtins.classmethod
| builtins.object
|
| Methods defined here:
|
| __init__(self, callable)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __isabstractmethod__ = True
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.classmethod:
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.classmethod:
|
| __new__(*args, **kwargs) class method of builtins.classmethod
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.classmethod:
|
| __dict__
|
| __func__
|
| __wrapped__
class abstractproperty(builtins.property)
| abstractproperty(fget=None, fset=None, fdel=None, doc=None)
|
| A decorator indicating abstract properties.
|
| Deprecated, use 'property' with 'abstractmethod' instead:
|
| class C(ABC):
| @property
| @abstractmethod
| def my_abstract_property(self):
| ...
|
| Method resolution order:
| abstractproperty
| builtins.property
| builtins.object
|
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __isabstractmethod__ = True
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.property:
|
| __delete__(self, instance, /)
| Delete an attribute of instance.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __set__(self, instance, value, /)
| Set an attribute of instance to value.
|
| __set_name__(...)
| Method to set name of a property.
|
| deleter(...)
| Descriptor to obtain a copy of the property with a different deleter.
|
| getter(...)
| Descriptor to obtain a copy of the property with a different getter.
|
| setter(...)
| Descriptor to obtain a copy of the property with a different setter.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.property:
|
| __new__(*args, **kwargs) class method of builtins.property
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.property:
|
| fdel
|
| fget
|
| fset
class abstractstaticmethod(builtins.staticmethod)
| abstractstaticmethod(callable)
|
| A decorator indicating abstract staticmethods.
|
| Deprecated, use 'staticmethod' with 'abstractmethod' instead:
|
| class C(ABC):
| @staticmethod
| @abstractmethod
| def my_abstract_staticmethod(...):
| ...
|
| Method resolution order:
| abstractstaticmethod
| builtins.staticmethod
| builtins.object
|
| Methods defined here:
|
| __init__(self, callable)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __isabstractmethod__ = True
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.staticmethod:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.staticmethod:
|
| __new__(*args, **kwargs) class method of builtins.staticmethod
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.staticmethod:
|
| __dict__
|
| __func__
|
| __wrapped__
FUNCTIONS
abstractmethod(funcobj)
A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or derived from it. A
class that has a metaclass derived from ABCMeta cannot be
instantiated unless all of its abstract methods are overridden.
The abstract methods can be called using any of the normal
'super' call mechanisms. abstractmethod() may be used to declare
abstract methods for properties and descriptors.
Usage:
class C(metaclass=ABCMeta):
@abstractmethod
def my_abstract_method(self, arg1, arg2, argN):
...
get_cache_token()
Returns the current ABC cache token.
The token is an opaque object (supporting equality testing) identifying the
current version of the ABC cache for virtual subclasses. The token changes
with every call to register() on any ABC.
update_abstractmethods(cls)
Recalculate the set of abstract methods of an abstract class.
If a class has had one of its abstract methods implemented after the
class was created, the method will not be considered implemented until
this function is called. Alternatively, if a new abstract method has been
added to the class, it will only be considered an abstract method of the
class after this function is called.
This function should be called before any use is made of the class,
usually in class decorators that add methods to the subject class.
Returns cls, to allow usage as a class decorator.
If cls is not an instance of ABCMeta, does nothing.
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\abc.py
dataclasses.asdict
Python Library Documentation: function asdict in module dataclasses
asdict(obj, *, dict_factory=<class 'dict'>)
Return the fields of a dataclass instance as a new dictionary mapping
field names to field values.
Example usage::
@dataclass
class C:
x: int
y: int
c = C(1, 2)
assert asdict(c) == {'x': 1, 'y': 2}
If given, 'dict_factory' will be used instead of built-in dict.
The function applies recursively to field values that are
dataclass instances. This will also look into built-in containers:
tuples, lists, and dicts. Other objects are copied with 'copy.deepcopy()'.
dataclasses.astuple
Python Library Documentation: function astuple in module dataclasses
astuple(obj, *, tuple_factory=<class 'tuple'>)
Return the fields of a dataclass instance as a new tuple of field values.
Example usage::
@dataclass
class C:
x: int
y: int
c = C(1, 2)
assert astuple(c) == (1, 2)
If given, 'tuple_factory' will be used instead of built-in tuple.
The function applies recursively to field values that are
dataclass instances. This will also look into built-in containers:
tuples, lists, and dicts. Other objects are copied with 'copy.deepcopy()'.
dataclasses.copy
Python Library Documentation: module copy
NAME
copy - Generic (shallow and deep) copying operations.
MODULE REFERENCE
https://docs.python.org/3.12/library/copy.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).
- A shallow copy constructs a new compound object and then (to the
extent possible) inserts *the same objects* into it that the
original contains.
- A deep copy constructs a new compound object and then, recursively,
inserts *copies* into it of the objects found in the original.
Two problems often exist with deep copy operations that don't exist
with shallow copy operations:
a) recursive objects (compound objects that, directly or indirectly,
contain a reference to themselves) may cause a recursive loop
b) because deep copy copies *everything* it may copy too much, e.g.
administrative data structures that should be shared even between
copies
Python's deep copy operation avoids these problems by:
a) keeping a table of objects already copied during the current
copying pass
b) letting user-defined classes override the copying operation or the
set of components copied
This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor any
similar types.
Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__(). See the documentation for module
"pickle" for information on these methods.
CLASSES
builtins.Exception(builtins.BaseException)
Error
class Error(builtins.Exception)
| Method resolution order:
| Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
FUNCTIONS
copy(x)
Shallow copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
deepcopy(x, memo=None, _nil=[])
Deep copy operation on arbitrary Python objects.
See the module's __doc__ string for more info.
DATA
__all__ = ['Error', 'copy', 'deepcopy']
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\copy.py
dataclasses.dataclass
Python Library Documentation: function dataclass in module dataclasses
dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False)
Add dunder methods based on the fields defined in the class.
Examines PEP 526 __annotations__ to determine fields.
If init is true, an __init__() method is added to the class. If repr
is true, a __repr__() method is added. If order is true, rich
comparison dunder methods are added. If unsafe_hash is true, a
__hash__() method is added. If frozen is true, fields may not be
assigned to after instance creation. If match_args is true, the
__match_args__ tuple is added. If kw_only is true, then by default
all fields are keyword-only. If slots is true, a new class with a
__slots__ attribute is returned.
dataclasses.field
Python Library Documentation: function field in module dataclasses
field(*, default=<dataclasses._MISSING_TYPE object at 0x00000222FA6894C0>, default_factory=<dataclasses._MISSING_TYPE object at 0x00000222FA6894C0>, init=True, repr=True, hash=None, compare=True, metadata=None, kw_only=<dataclasses._MISSING_TYPE object at 0x00000222FA6894C0>)
Return an object to identify dataclass fields.
default is the default value of the field. default_factory is a
0-argument function called to initialize a field's value. If init
is true, the field will be a parameter to the class's __init__()
function. If repr is true, the field will be included in the
object's repr(). If hash is true, the field will be included in the
object's hash(). If compare is true, the field will be used in
comparison functions. metadata, if specified, must be a mapping
which is stored but not otherwise examined by dataclass. If kw_only
is true, the field will become a keyword-only parameter to
__init__().
It is an error to specify both default and default_factory.
dataclasses.fields
Python Library Documentation: function fields in module dataclasses
fields(class_or_instance)
Return a tuple describing the fields of this dataclass.
Accepts a dataclass or an instance of one. Tuple elements are of
type Field.
dataclasses.functools
Python Library Documentation: module functools
NAME
functools - functools.py - Tools for working with functions and callable objects
MODULE REFERENCE
https://docs.python.org/3.12/library/functools.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
CLASSES
builtins.object
cached_property
partial
partialmethod
singledispatchmethod
class cached_property(builtins.object)
| cached_property(func)
|
| Methods defined here:
|
| __get__(self, instance, owner=None)
|
| __init__(self, func)
| Initialize self. See help(type(self)) for accurate signature.
|
| __set_name__(self, owner, name)
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__ = GenericAlias(...)
| Represent a PEP 585 generic type
|
| E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class partial(builtins.object)
| partial(func, *args, **keywords) - new function with partial application
| of the given arguments and keywords.
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__(...)
| See PEP 585
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
|
| __vectorcalloffset__
|
| args
| tuple of arguments to future partial calls
|
| func
| function object to use in future partial calls
|
| keywords
| dictionary of keyword arguments to future partial calls
class partialmethod(builtins.object)
| partialmethod(func, /, *args, **keywords)
|
| Method descriptor with partial application of the given arguments
| and keywords.
|
| Supports wrapping existing descriptors and handles non-descriptor
| callables as instance methods.
|
| Methods defined here:
|
| __get__(self, obj, cls=None)
|
| __init__(self, func, /, *args, **keywords)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__ = GenericAlias(...)
| Represent a PEP 585 generic type
|
| E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| __isabstractmethod__
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class singledispatchmethod(builtins.object)
| singledispatchmethod(func)
|
| Single-dispatch generic method descriptor.
|
| Supports wrapping existing descriptors and handles non-descriptor
| callables as instance methods.
|
| Methods defined here:
|
| __get__(self, obj, cls=None)
|
| __init__(self, func)
| Initialize self. See help(type(self)) for accurate signature.
|
| register(self, cls, method=None)
| generic_method.register(cls, func) -> func
|
| Registers a new implementation for the given *cls* on a *generic_method*.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| __isabstractmethod__
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
FUNCTIONS
cache(user_function, /)
Simple lightweight unbounded cache. Sometimes called "memoize".
cmp_to_key(mycmp)
Convert a cmp= function into a key= function.
mycmp
Function that compares two objects.
lru_cache(maxsize=128, typed=False)
Least-recently-used cache decorator.
If *maxsize* is set to None, the LRU features are disabled and the cache
can grow without bound.
If *typed* is True, arguments of different types will be cached separately.
For example, f(3.0) and f(3) will be treated as distinct calls with
distinct results.
Arguments to the cached function must be hashable.
View the cache statistics named tuple (hits, misses, maxsize, currsize)
with f.cache_info(). Clear the cache and statistics with f.cache_clear().
Access the underlying function with f.__wrapped__.
See: https://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)
reduce(...)
reduce(function, iterable[, initial]) -> value
Apply a function of two arguments cumulatively to the items of a sequence
or iterable, from left to right, so as to reduce the iterable to a single
value. For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
((((1+2)+3)+4)+5). If initial is present, it is placed before the items
of the iterable in the calculation, and serves as a default when the
iterable is empty.
singledispatch(func)
Single-dispatch generic function decorator.
Transforms a function into a generic function, which can have different
behaviours depending upon the type of its first argument. The decorated
function acts as the default implementation, and additional
implementations can be registered using the register() attribute of the
generic function.
total_ordering(cls)
Class decorator that fills in missing ordering methods
update_wrapper(wrapper, wrapped, assigned=('__module__', '__name__', '__qualname__', '__doc__', '__annotations__', '__type_params__'), updated=('__dict__',))
Update a wrapper function to look like the wrapped function
wrapper is the function to be updated
wrapped is the original function
assigned is a tuple naming the attributes assigned directly
from the wrapped function to the wrapper function (defaults to
functools.WRAPPER_ASSIGNMENTS)
updated is a tuple naming the attributes of the wrapper that
are updated with the corresponding attribute from the wrapped
function (defaults to functools.WRAPPER_UPDATES)
wraps(wrapped, assigned=('__module__', '__name__', '__qualname__', '__doc__', '__annotations__', '__type_params__'), updated=('__dict__',))
Decorator factory to apply update_wrapper() to a wrapper function
Returns a decorator that invokes update_wrapper() with the decorated
function as the wrapper argument and the arguments to wraps() as the
remaining arguments. Default arguments are as for update_wrapper().
This is a convenience function to simplify applying partial() to
update_wrapper().
DATA
WRAPPER_ASSIGNMENTS = ('__module__', '__name__', '__qualname__', '__do...
WRAPPER_UPDATES = ('__dict__',)
__all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_...
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\functools.py
dataclasses.inspect
Python Library Documentation: module inspect
NAME
inspect - Get useful information from live Python objects.
MODULE REFERENCE
https://docs.python.org/3.12/library/inspect.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.
Here are some of the useful functions provided by this module:
ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
isroutine() - check object types
getmembers() - get members of an object that satisfy a given condition
getfile(), getsourcefile(), getsource() - find an object's source code
getdoc(), getcomments() - get documentation on an object
getmodule() - determine the module that an object came from
getclasstree() - arrange classes so as to represent their hierarchy
getargvalues(), getcallargs() - get info about function arguments
getfullargspec() - same, with support for Python 3 features
formatargvalues() - format an argument spec
getouterframes(), getinnerframes() - get info about frames
currentframe() - get the current stack frame
stack(), trace() - get info about frames on the stack or in a traceback
signature() - get a Signature object for the callable
get_annotations() - safely compute an object's annotations
CLASSES
builtins.Exception(builtins.BaseException)
ClassFoundException
EndOfBlock
builtins.object
BlockFinder
BoundArguments
Parameter
Signature
builtins.tuple(builtins.object)
ArgInfo
Arguments
Attribute
ClosureVars
FullArgSpec
enum.IntFlag(builtins.int, enum.ReprEnum, enum.Flag)
BufferFlags
_FrameInfo(builtins.tuple)
FrameInfo
_Traceback(builtins.tuple)
Traceback
class ArgInfo(builtins.tuple)
| ArgInfo(args, varargs, keywords, locals)
|
| ArgInfo(args, varargs, keywords, locals)
|
| Method resolution order:
| ArgInfo
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __getnewargs__(self) from collections.ArgInfo
| Return self as a plain tuple. Used by copy and pickle.
|
| __repr__(self) from collections.ArgInfo
| Return a nicely formatted representation string
|
| _asdict(self) from collections.ArgInfo
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections.ArgInfo
| Return a new ArgInfo object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| _make(iterable) from collections.ArgInfo
| Make a new ArgInfo object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(_cls, args, varargs, keywords, locals) from namedtuple_ArgInfo.ArgInfo
| Create new instance of ArgInfo(args, varargs, keywords, locals)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| args
| Alias for field number 0
|
| varargs
| Alias for field number 1
|
| keywords
| Alias for field number 2
|
| locals
| Alias for field number 3
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __match_args__ = ('args', 'varargs', 'keywords', 'locals')
|
| _field_defaults = {}
|
| _fields = ('args', 'varargs', 'keywords', 'locals')
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| index(self, value, start=0, stop=9223372036854775807, /)
| Return first index of value.
|
| Raises ValueError if the value is not present.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
class Arguments(builtins.tuple)
| Arguments(args, varargs, varkw)
|
| Arguments(args, varargs, varkw)
|
| Method resolution order:
| Arguments
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __getnewargs__(self) from collections.Arguments
| Return self as a plain tuple. Used by copy and pickle.
|
| __repr__(self) from collections.Arguments
| Return a nicely formatted representation string
|
| _asdict(self) from collections.Arguments
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections.Arguments
| Return a new Arguments object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| _make(iterable) from collections.Arguments
| Make a new Arguments object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(_cls, args, varargs, varkw) from namedtuple_Arguments.Arguments
| Create new instance of Arguments(args, varargs, varkw)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| args
| Alias for field number 0
|
| varargs
| Alias for field number 1
|
| varkw
| Alias for field number 2
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __match_args__ = ('args', 'varargs', 'varkw')
|
| _field_defaults = {}
|
| _fields = ('args', 'varargs', 'varkw')
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| index(self, value, start=0, stop=9223372036854775807, /)
| Return first index of value.
|
| Raises ValueError if the value is not present.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
class Attribute(builtins.tuple)
| Attribute(name, kind, defining_class, object)
|
| Attribute(name, kind, defining_class, object)
|
| Method resolution order:
| Attribute
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __getnewargs__(self) from collections.Attribute
| Return self as a plain tuple. Used by copy and pickle.
|
| __repr__(self) from collections.Attribute
| Return a nicely formatted representation string
|
| _asdict(self) from collections.Attribute
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections.Attribute
| Return a new Attribute object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| _make(iterable) from collections.Attribute
| Make a new Attribute object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(_cls, name, kind, defining_class, object) from namedtuple_Attribute.Attribute
| Create new instance of Attribute(name, kind, defining_class, object)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| name
| Alias for field number 0
|
| kind
| Alias for field number 1
|
| defining_class
| Alias for field number 2
|
| object
| Alias for field number 3
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __match_args__ = ('name', 'kind', 'defining_class', 'object')
|
| _field_defaults = {}
|
| _fields = ('name', 'kind', 'defining_class', 'object')
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| index(self, value, start=0, stop=9223372036854775807, /)
| Return first index of value.
|
| Raises ValueError if the value is not present.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
class BlockFinder(builtins.object)
| Provide a tokeneater() method to detect the end of a code block.
|
| Methods defined here:
|
| __init__(self)
| Initialize self. See help(type(self)) for accurate signature.
|
| tokeneater(self, type, token, srowcol, erowcol, line)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
class BoundArguments(builtins.object)
| BoundArguments(signature, arguments)
|
| Result of `Signature.bind` call. Holds the mapping of arguments
| to the function's parameters.
|
| Has the following public attributes:
|
| * arguments : dict
| An ordered mutable mapping of parameters' names to arguments' values.
| Does not contain arguments' default values.
| * signature : Signature
| The Signature object that created this instance.
| * args : tuple
| Tuple of positional arguments values.
| * kwargs : dict
| Dict of keyword arguments values.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __getstate__(self)
| Helper for pickle.
|
| __init__(self, signature, arguments)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self)
| Return repr(self).
|
| __setstate__(self, state)
|
| apply_defaults(self)
| Set default values for missing arguments.
|
| For variable-positional arguments (*args) the default is an
| empty tuple.
|
| For variable-keyword arguments (**kwargs) the default is an
| empty dict.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| args
|
| kwargs
|
| signature
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| arguments
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __hash__ = None
class BufferFlags(enum.IntFlag)
| BufferFlags(*values)
|
| Method resolution order:
| BufferFlags
| enum.IntFlag
| builtins.int
| enum.ReprEnum
| enum.Flag
| enum.Enum
| builtins.object
|
| Methods defined here:
|
| __and__(self, other) from enum.Flag
|
| __format__(self, format_spec, /) from builtins.int
| Convert to a string according to format_spec.
|
| __invert__(self) from enum.Flag
|
| __new__(cls, value) from enum.Enum
| Create and return a new object. See help(type) for accurate signature.
|
| __or__(self, other) from enum.Flag
| Return self|value.
|
| __rand__ = __and__(self, other)
|
| __ror__ = __or__(self, other)
|
| __rxor__ = __xor__(self, other)
|
| __xor__(self, other) from enum.Flag
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| FORMAT = <BufferFlags.FORMAT: 4>
|
| ND = <BufferFlags.ND: 8>
|
| READ = <BufferFlags.READ: 256>
|
| WRITABLE = <BufferFlags.WRITABLE: 1>
|
| WRITE = <BufferFlags.WRITE: 512>
|
| ----------------------------------------------------------------------
| Methods inherited from enum.IntFlag:
|
| __repr__(self) from enum.Flag
| Return repr(self).
|
| __str__ = __repr__(self, /) from builtins.int
| Return repr(self).
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.int:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| True if self else False
|
| __ceil__(...)
| Ceiling of an Integral returns itself.
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floor__(...)
| Flooring an Integral returns itself.
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getnewargs__(self, /)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __index__(self, /)
| Return self converted to an integer, if self is suitable for use as an index into a list.
|
| __int__(self, /)
| int(self)
|
| __le__(self, value, /)
| Return self<=value.
|
| __lshift__(self, value, /)
| Return self<<value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rlshift__(self, value, /)
| Return value<<self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __round__(...)
| Rounding an Integral returns itself.
|
| Rounding with an ndigits argument also returns an integer.
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rrshift__(self, value, /)
| Return value>>self.
|
| __rshift__(self, value, /)
| Return self>>value.
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __sizeof__(self, /)
| Returns size in memory, in bytes.
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(...)
| Truncating an Integral returns itself.
|
| as_integer_ratio(self, /)
| Return a pair of integers, whose ratio is equal to the original int.
|
| The ratio is in lowest terms and has a positive denominator.
|
| >>> (10).as_integer_ratio()
| (10, 1)
| >>> (-10).as_integer_ratio()
| (-10, 1)
| >>> (0).as_integer_ratio()
| (0, 1)
|
| bit_count(self, /)
| Number of ones in the binary representation of the absolute value of self.
|
| Also known as the population count.
|
| >>> bin(13)
| '0b1101'
| >>> (13).bit_count()
| 3
|
| bit_length(self, /)
| Number of bits necessary to represent self in binary.
|
| >>> bin(37)
| '0b100101'
| >>> (37).bit_length()
| 6
|
| conjugate(...)
| Returns self, the complex conjugate of any int.
|
| is_integer(self, /)
| Returns True. Exists for duck type compatibility with float.is_integer.
|
| to_bytes(self, /, length=1, byteorder='big', *, signed=False)
| Return an array of bytes representing an integer.
|
| length
| Length of bytes object to use. An OverflowError is raised if the
| integer is not representable with the given number of bytes. Default
| is length 1.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value. Default is to use 'big'.
| signed
| Determines whether two's complement is used to represent the integer.
| If signed is False and a negative integer is given, an OverflowError
| is raised.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.int:
|
| from_bytes(bytes, byteorder='big', *, signed=False)
| Return the integer represented by the given array of bytes.
|
| bytes
| Holds the array of bytes to convert. The argument must either
| support the buffer protocol or be an iterable object producing bytes.
| Bytes and bytearray are examples of built-in objects that support the
| buffer protocol.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value. Default is to use 'big'.
| signed
| Indicates whether two's complement is used to represent the integer.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.int:
|
| denominator
| the denominator of a rational number in lowest terms
|
| imag
| the imaginary part of a complex number
|
| numerator
| the numerator of a rational number in lowest terms
|
| real
| the real part of a complex number
|
| ----------------------------------------------------------------------
| Methods inherited from enum.Flag:
|
| __contains__(self, other)
| Returns True if self has at least the same flags set as other.
|
| __iter__(self)
| Returns flags in definition order.
|
| __len__(self)
| Return the number of members (no aliases)
|
| ----------------------------------------------------------------------
| Methods inherited from enum.Enum:
|
| __dir__(self)
| Returns public methods and other interesting attributes.
|
| __init__(self, *args, **kwds)
| Initialize self. See help(type(self)) for accurate signature.
|
| __reduce_ex__(self, proto)
| Helper for pickle.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Static methods inherited from enum.EnumType:
|
| __getitem__(name)
| Return the member matching `name`.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumType:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
class ClassFoundException(builtins.Exception)
| Method resolution order:
| ClassFoundException
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class ClosureVars(builtins.tuple)
| ClosureVars(nonlocals, globals, builtins, unbound)
|
| ClosureVars(nonlocals, globals, builtins, unbound)
|
| Method resolution order:
| ClosureVars
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __getnewargs__(self) from collections.ClosureVars
| Return self as a plain tuple. Used by copy and pickle.
|
| __repr__(self) from collections.ClosureVars
| Return a nicely formatted representation string
|
| _asdict(self) from collections.ClosureVars
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections.ClosureVars
| Return a new ClosureVars object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| _make(iterable) from collections.ClosureVars
| Make a new ClosureVars object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(_cls, nonlocals, globals, builtins, unbound) from namedtuple_ClosureVars.ClosureVars
| Create new instance of ClosureVars(nonlocals, globals, builtins, unbound)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| nonlocals
| Alias for field number 0
|
| globals
| Alias for field number 1
|
| builtins
| Alias for field number 2
|
| unbound
| Alias for field number 3
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __match_args__ = ('nonlocals', 'globals', 'builtins', 'unbound')
|
| _field_defaults = {}
|
| _fields = ('nonlocals', 'globals', 'builtins', 'unbound')
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| index(self, value, start=0, stop=9223372036854775807, /)
| Return first index of value.
|
| Raises ValueError if the value is not present.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
class EndOfBlock(builtins.Exception)
| Method resolution order:
| EndOfBlock
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
class FrameInfo(_FrameInfo)
| FrameInfo(frame, filename, lineno, function, code_context, index, *, positions=None)
|
| Method resolution order:
| FrameInfo
| _FrameInfo
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __repr__(self)
| Return a nicely formatted representation string
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(cls, frame, filename, lineno, function, code_context, index, *, positions=None)
| Create new instance of _FrameInfo(frame, filename, lineno, function, code_context, index)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| ----------------------------------------------------------------------
| Methods inherited from _FrameInfo:
|
| __getnewargs__(self) from collections._FrameInfo
| Return self as a plain tuple. Used by copy and pickle.
|
| _asdict(self) from collections._FrameInfo
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections._FrameInfo
| Return a new _FrameInfo object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods inherited from _FrameInfo:
|
| _make(iterable) from collections._FrameInfo
| Make a new _FrameInfo object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Data descriptors inherited from _FrameInfo:
|
| frame
| Alias for field number 0
|
| filename
| Alias for field number 1
|
| lineno
| Alias for field number 2
|
| function
| Alias for field number 3
|
| code_context
| Alias for field number 4
|
| index
| Alias for field number 5
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from _FrameInfo:
|
| __match_args__ = ('frame', 'filename', 'lineno', 'function', 'code_con...
|
| _field_defaults = {}
|
| _fields = ('frame', 'filename', 'lineno', 'function', 'code_context', ...
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
class FullArgSpec(builtins.tuple)
| FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
|
| FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
|
| Method resolution order:
| FullArgSpec
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __getnewargs__(self) from collections.FullArgSpec
| Return self as a plain tuple. Used by copy and pickle.
|
| __repr__(self) from collections.FullArgSpec
| Return a nicely formatted representation string
|
| _asdict(self) from collections.FullArgSpec
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections.FullArgSpec
| Return a new FullArgSpec object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| _make(iterable) from collections.FullArgSpec
| Make a new FullArgSpec object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(_cls, args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations) from namedtuple_FullArgSpec.FullArgSpec
| Create new instance of FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| args
| Alias for field number 0
|
| varargs
| Alias for field number 1
|
| varkw
| Alias for field number 2
|
| defaults
| Alias for field number 3
|
| kwonlyargs
| Alias for field number 4
|
| kwonlydefaults
| Alias for field number 5
|
| annotations
| Alias for field number 6
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __match_args__ = ('args', 'varargs', 'varkw', 'defaults', 'kwonlyargs'...
|
| _field_defaults = {}
|
| _fields = ('args', 'varargs', 'varkw', 'defaults', 'kwonlyargs', 'kwon...
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| index(self, value, start=0, stop=9223372036854775807, /)
| Return first index of value.
|
| Raises ValueError if the value is not present.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
class Parameter(builtins.object)
| Parameter(name, kind, *, default, annotation)
|
| Represents a parameter in a function signature.
|
| Has the following public attributes:
|
| * name : str
| The name of the parameter as a string.
| * default : object
| The default value for the parameter if specified. If the
| parameter has no default value, this attribute is set to
| `Parameter.empty`.
| * annotation
| The annotation for the parameter if specified. If the
| parameter has no annotation, this attribute is set to
| `Parameter.empty`.
| * kind : str
| Describes how argument values are bound to the parameter.
| Possible values: `Parameter.POSITIONAL_ONLY`,
| `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
| `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, name, kind, *, default, annotation)
| Initialize self. See help(type(self)) for accurate signature.
|
| __reduce__(self)
| Helper for pickle.
|
| __repr__(self)
| Return repr(self).
|
| __setstate__(self, state)
|
| __str__(self)
| Return str(self).
|
| replace(self, *, name=<class 'inspect._void'>, kind=<class 'inspect._void'>, annotation=<class 'inspect._void'>, default=<class 'inspect._void'>)
| Creates a customized copy of the Parameter.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| annotation
|
| default
|
| kind
|
| name
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| KEYWORD_ONLY = <_ParameterKind.KEYWORD_ONLY: 3>
|
| POSITIONAL_ONLY = <_ParameterKind.POSITIONAL_ONLY: 0>
|
| POSITIONAL_OR_KEYWORD = <_ParameterKind.POSITIONAL_OR_KEYWORD: 1>
|
| VAR_KEYWORD = <_ParameterKind.VAR_KEYWORD: 4>
|
| VAR_POSITIONAL = <_ParameterKind.VAR_POSITIONAL: 2>
|
| empty = <class 'inspect._empty'>
| Marker object for Signature.empty and Parameter.empty.
class Signature(builtins.object)
| Signature(parameters=None, *, return_annotation, __validate_parameters__=True)
|
| A Signature object represents the overall signature of a function.
| It stores a Parameter object for each parameter accepted by the
| function, as well as information specific to the function itself.
|
| A Signature object has the following public attributes and methods:
|
| * parameters : OrderedDict
| An ordered mapping of parameters' names to the corresponding
| Parameter objects (keyword-only arguments are in the same order
| as listed in `code.co_varnames`).
| * return_annotation : object
| The annotation for the return type of the function if specified.
| If the function has no annotation for its return type, this
| attribute is set to `Signature.empty`.
| * bind(*args, **kwargs) -> BoundArguments
| Creates a mapping from positional and keyword arguments to
| parameters.
| * bind_partial(*args, **kwargs) -> BoundArguments
| Creates a partial mapping from positional and keyword arguments
| to parameters (simulating 'functools.partial' behavior.)
|
| Methods defined here:
|
| __eq__(self, other)
| Return self==value.
|
| __hash__(self)
| Return hash(self).
|
| __init__(self, parameters=None, *, return_annotation, __validate_parameters__=True)
| Constructs Signature from the given list of Parameter
| objects and 'return_annotation'. All arguments are optional.
|
| __reduce__(self)
| Helper for pickle.
|
| __repr__(self)
| Return repr(self).
|
| __setstate__(self, state)
|
| __str__(self)
| Return str(self).
|
| bind(self, /, *args, **kwargs)
| Get a BoundArguments object, that maps the passed `args`
| and `kwargs` to the function's signature. Raises `TypeError`
| if the passed arguments can not be bound.
|
| bind_partial(self, /, *args, **kwargs)
| Get a BoundArguments object, that partially maps the
| passed `args` and `kwargs` to the function's signature.
| Raises `TypeError` if the passed arguments can not be bound.
|
| replace(self, *, parameters=<class 'inspect._void'>, return_annotation=<class 'inspect._void'>)
| Creates a customized copy of the Signature.
| Pass 'parameters' and/or 'return_annotation' arguments
| to override them in the new copy.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| from_callable(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False)
| Constructs Signature for the given callable object.
|
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| parameters
|
| return_annotation
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| empty = <class 'inspect._empty'>
| Marker object for Signature.empty and Parameter.empty.
class Traceback(_Traceback)
| Traceback(filename, lineno, function, code_context, index, *, positions=None)
|
| Method resolution order:
| Traceback
| _Traceback
| builtins.tuple
| builtins.object
|
| Methods defined here:
|
| __repr__(self)
| Return a nicely formatted representation string
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(cls, filename, lineno, function, code_context, index, *, positions=None)
| Create new instance of _Traceback(filename, lineno, function, code_context, index)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| ----------------------------------------------------------------------
| Methods inherited from _Traceback:
|
| __getnewargs__(self) from collections._Traceback
| Return self as a plain tuple. Used by copy and pickle.
|
| _asdict(self) from collections._Traceback
| Return a new dict which maps field names to their values.
|
| _replace(self, /, **kwds) from collections._Traceback
| Return a new _Traceback object replacing specified fields with new values
|
| ----------------------------------------------------------------------
| Class methods inherited from _Traceback:
|
| _make(iterable) from collections._Traceback
| Make a new _Traceback object from a sequence or iterable
|
| ----------------------------------------------------------------------
| Data descriptors inherited from _Traceback:
|
| filename
| Alias for field number 0
|
| lineno
| Alias for field number 1
|
| function
| Alias for field number 2
|
| code_context
| Alias for field number 3
|
| index
| Alias for field number 4
|
| ----------------------------------------------------------------------
| Data and other attributes inherited from _Traceback:
|
| __match_args__ = ('filename', 'lineno', 'function', 'code_context', 'i...
|
| _field_defaults = {}
|
| _fields = ('filename', 'lineno', 'function', 'code_context', 'index')
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.tuple:
|
| __add__(self, value, /)
| Return self+value.
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __rmul__(self, value, /)
| Return value*self.
|
| count(self, value, /)
| Return number of occurrences of value.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.tuple:
|
| __class_getitem__(...)
| See PEP 585
FUNCTIONS
classify_class_attrs(cls)
Return list of attribute-descriptor tuples.
For each name in dir(cls), the return list contains a 4-tuple
with these elements:
0. The name (a string).
1. The kind of attribute this is, one of these strings:
'class method' created via classmethod()
'static method' created via staticmethod()
'property' created via property()
'method' any other flavor of method or descriptor
'data' not a method
2. The class which defined this attribute (a class).
3. The object as obtained by calling getattr; if this fails, or if the
resulting object does not live anywhere in the class' mro (including
metaclasses) then the object is looked up in the defining class's
dict (found by walking the mro).
If one of the items in dir(cls) is stored in the metaclass it will now
be discovered and not have None be listed as the class in which it was
defined. Any items whose home class cannot be discovered are skipped.
cleandoc(doc)
Clean up indentation from docstrings.
Any whitespace that can be uniformly removed from the second line
onwards is removed.
currentframe()
Return the frame of the caller or None if this is not possible.
findsource(object)
Return the entire source file and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of all the lines
in the file and the line number indexes a line in that list. An OSError
is raised if the source code cannot be retrieved.
formatannotation(annotation, base_module=None)
formatannotationrelativeto(object)
formatargvalues(args, varargs, varkw, locals, formatarg=<class 'str'>, formatvarargs=<function <lambda> at 0x00000222FA59C9A0>, formatvarkw=<function <lambda> at 0x00000222FA59CA40>, formatvalue=<function <lambda> at 0x00000222FA59CAE0>)
Format an argument spec from the 4 values returned by getargvalues.
The first four arguments are (args, varargs, varkw, locals). The
next four arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The ninth
argument is an optional function to format the sequence of arguments.
get_annotations(obj, *, globals=None, locals=None, eval_str=False)
Compute the annotations dict for an object.
obj may be a callable, class, or module.
Passing in an object of any other type raises TypeError.
Returns a dict. get_annotations() returns a new dict every time
it's called; calling it twice on the same object will return two
different but equivalent dicts.
This function handles several details for you:
* If eval_str is true, values of type str will
be un-stringized using eval(). This is intended
for use with stringized annotations
("from __future__ import annotations").
* If obj doesn't have an annotations dict, returns an
empty dict. (Functions and methods always have an
annotations dict; classes, modules, and other types of
callables may not.)
* Ignores inherited annotations on classes. If a class
doesn't have its own annotations dict, returns an empty dict.
* All accesses to object members and dict values are done
using getattr() and dict.get() for safety.
* Always, always, always returns a freshly-created dict.
eval_str controls whether or not values of type str are replaced
with the result of calling eval() on those values:
* If eval_str is true, eval() is called on values of type str.
* If eval_str is false (the default), values of type str are unchanged.
globals and locals are passed in to eval(); see the documentation
for eval() for more information. If either globals or locals is
None, this function may replace that value with a context-specific
default, contingent on type(obj):
* If obj is a module, globals defaults to obj.__dict__.
* If obj is a class, globals defaults to
sys.modules[obj.__module__].__dict__ and locals
defaults to the obj class namespace.
* If obj is a callable, globals defaults to obj.__globals__,
although if obj is a wrapped function (using
functools.update_wrapper()) it is first unwrapped.
getabsfile(object, _filename=None)
Return an absolute path to the source or compiled file for an object.
The idea is for each object to have a unique origin, so this routine
normalizes the result as much as possible.
getargs(co)
Get information about the arguments accepted by a code object.
Three things are returned: (args, varargs, varkw), where
'args' is the list of argument names. Keyword-only arguments are
appended. 'varargs' and 'varkw' are the names of the * and **
arguments or None.
getargvalues(frame)
Get information about arguments passed into a particular frame.
A tuple of four things is returned: (args, varargs, varkw, locals).
'args' is a list of the argument names.
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'locals' is the locals dictionary of the given frame.
getasyncgenlocals(agen)
Get the mapping of asynchronous generator local variables to their current
values.
A dict is returned, with the keys the local variable names and values the
bound values.
getasyncgenstate(agen)
Get current state of an asynchronous generator object.
Possible states are:
AGEN_CREATED: Waiting to start execution.
AGEN_RUNNING: Currently being executed by the interpreter.
AGEN_SUSPENDED: Currently suspended at a yield expression.
AGEN_CLOSED: Execution has completed.
getattr_static(obj, attr, default=<object object at 0x00000222F9D687B0>)
Retrieve attributes without triggering dynamic lookup via the
descriptor protocol, __getattr__ or __getattribute__.
Note: this function may not be able to retrieve all attributes
that getattr can fetch (like dynamically created attributes)
and may find attributes that getattr can't (like descriptors
that raise AttributeError). It can also return descriptor objects
instead of instance members in some cases. See the
documentation for details.
getblock(lines)
Extract the block of code at the top of the given list of lines.
getcallargs(func, /, *positional, **named)
Get the mapping of arguments to values.
A dict is returned, with keys the function argument names (including the
names of the * and ** arguments, if any), and values the respective bound
values from 'positional' and 'named'.
getclasstree(classes, unique=False)
Arrange the given list of classes into a hierarchy of nested lists.
Where a nested list appears, it contains classes derived from the class
whose entry immediately precedes the list. Each entry is a 2-tuple
containing a class and a tuple of its base classes. If the 'unique'
argument is true, exactly one entry appears in the returned structure
for each class in the given list. Otherwise, classes using multiple
inheritance and their descendants will appear multiple times.
getclosurevars(func)
Get the mapping of free variables to their current values.
Returns a named tuple of dicts mapping the current nonlocal, global
and builtin references as seen by the body of the function. A final
set of unbound names that could not be resolved is also provided.
getcomments(object)
Get lines of comments immediately preceding an object's source code.
Returns None when source can't be found.
getcoroutinelocals(coroutine)
Get the mapping of coroutine local variables to their current values.
A dict is returned, with the keys the local variable names and values the
bound values.
getcoroutinestate(coroutine)
Get current state of a coroutine object.
Possible states are:
CORO_CREATED: Waiting to start execution.
CORO_RUNNING: Currently being executed by the interpreter.
CORO_SUSPENDED: Currently suspended at an await expression.
CORO_CLOSED: Execution has completed.
getdoc(object)
Get the documentation string for an object.
All tabs are expanded to spaces. To clean up docstrings that are
indented to line up with blocks of code, any whitespace than can be
uniformly removed from the second line onwards is removed.
getfile(object)
Work out which source or compiled file an object was defined in.
getframeinfo(frame, context=1)
Get information about a frame or traceback object.
A tuple of five things is returned: the filename, the line number of
the current line, the function name, a list of lines of context from
the source code, and the index of the current line within that list.
The optional second argument specifies the number of lines of context
to return, which are centered around the current line.
getfullargspec(func)
Get the names and default values of a callable object's parameters.
A tuple of seven things is returned:
(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
'args' is a list of the parameter names.
'varargs' and 'varkw' are the names of the * and ** parameters or None.
'defaults' is an n-tuple of the default values of the last n parameters.
'kwonlyargs' is a list of keyword-only parameter names.
'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
'annotations' is a dictionary mapping parameter names to annotations.
Notable differences from inspect.signature():
- the "self" parameter is always reported, even for bound methods
- wrapper chains defined by __wrapped__ *not* unwrapped automatically
getgeneratorlocals(generator)
Get the mapping of generator local variables to their current values.
A dict is returned, with the keys the local variable names and values the
bound values.
getgeneratorstate(generator)
Get current state of a generator-iterator.
Possible states are:
GEN_CREATED: Waiting to start execution.
GEN_RUNNING: Currently being executed by the interpreter.
GEN_SUSPENDED: Currently suspended at a yield expression.
GEN_CLOSED: Execution has completed.
getinnerframes(tb, context=1)
Get a list of records for a traceback's frame and all lower frames.
Each record contains a frame object, filename, line number, function
name, a list of lines of context, and index within the context.
getlineno(frame)
Get the line number from a frame object, allowing for optimization.
getmembers(object, predicate=None)
Return all members of an object as (name, value) pairs sorted by name.
Optionally, only return members that satisfy a given predicate.
getmembers_static(object, predicate=None)
Return all members of an object as (name, value) pairs sorted by name
without triggering dynamic lookup via the descriptor protocol,
__getattr__ or __getattribute__. Optionally, only return members that
satisfy a given predicate.
Note: this function may not be able to retrieve all members
that getmembers can fetch (like dynamically created attributes)
and may find members that getmembers can't (like descriptors
that raise AttributeError). It can also return descriptor objects
instead of instance members in some cases.
getmodule(object, _filename=None)
Return the module an object was defined in, or None if not found.
getmodulename(path)
Return the module name for a given file, or None.
getmro(cls)
Return tuple of base classes (including cls) in method resolution order.
getouterframes(frame, context=1)
Get a list of records for a frame and all higher (calling) frames.
Each record contains a frame object, filename, line number, function
name, a list of lines of context, and index within the context.
getsource(object)
Return the text of the source code for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a single string. An
OSError is raised if the source code cannot be retrieved.
getsourcefile(object)
Return the filename that can be used to locate an object's source.
Return None if no way can be identified to get the source.
getsourcelines(object)
Return a list of source lines and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of the lines
corresponding to the object and the line number indicates where in the
original source file the first line of code was found. An OSError is
raised if the source code cannot be retrieved.
indentsize(line)
Return the indent size, in spaces, at the start of a line of text.
isabstract(object)
Return true if the object is an abstract base class (ABC).
isasyncgen(object)
Return true if the object is an asynchronous generator.
isasyncgenfunction(obj)
Return true if the object is an asynchronous generator function.
Asynchronous generator functions are defined with "async def"
syntax and have "yield" expressions in their body.
isawaitable(object)
Return true if object can be passed to an ``await`` expression.
isbuiltin(object)
Return true if the object is a built-in function or method.
Built-in functions and methods provide these attributes:
__doc__ documentation string
__name__ original name of this function or method
__self__ instance to which a method is bound, or None
isclass(object)
Return true if the object is a class.
iscode(object)
Return true if the object is a code object.
Code objects provide these attributes:
co_argcount number of arguments (not including *, ** args
or keyword only arguments)
co_code string of raw compiled bytecode
co_cellvars tuple of names of cell variables
co_consts tuple of constants used in the bytecode
co_filename name of file in which this code object was created
co_firstlineno number of first line in Python source code
co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
| 16=nested | 32=generator | 64=nofree | 128=coroutine
| 256=iterable_coroutine | 512=async_generator
co_freevars tuple of names of free variables
co_posonlyargcount number of positional only arguments
co_kwonlyargcount number of keyword only arguments (not including ** arg)
co_lnotab encoded mapping of line numbers to bytecode indices
co_name name with which this code object was defined
co_names tuple of names other than arguments and function locals
co_nlocals number of local variables
co_stacksize virtual machine stack space required
co_varnames tuple of names of arguments and local variables
iscoroutine(object)
Return true if the object is a coroutine.
iscoroutinefunction(obj)
Return true if the object is a coroutine function.
Coroutine functions are normally defined with "async def" syntax, but may
be marked via markcoroutinefunction.
isdatadescriptor(object)
Return true if the object is a data descriptor.
Data descriptors have a __set__ or a __delete__ attribute. Examples are
properties (defined in Python) and getsets and members (defined in C).
Typically, data descriptors will also have __name__ and __doc__ attributes
(properties, getsets, and members have both of these attributes), but this
is not guaranteed.
isframe(object)
Return true if the object is a frame object.
Frame objects provide these attributes:
f_back next outer frame object (this frame's caller)
f_builtins built-in namespace seen by this frame
f_code code object being executed in this frame
f_globals global namespace seen by this frame
f_lasti index of last attempted instruction in bytecode
f_lineno current line number in Python source code
f_locals local namespace seen by this frame
f_trace tracing function for this frame, or None
isfunction(object)
Return true if the object is a user-defined function.
Function objects provide these attributes:
__doc__ documentation string
__name__ name with which this function was defined
__code__ code object containing compiled function bytecode
__defaults__ tuple of any default values for arguments
__globals__ global namespace in which this function was defined
__annotations__ dict of parameter annotations
__kwdefaults__ dict of keyword only parameters with defaults
isgenerator(object)
Return true if the object is a generator.
Generator objects provide these attributes:
__iter__ defined to support iteration over container
close raises a new GeneratorExit exception inside the
generator to terminate the iteration
gi_code code object
gi_frame frame object or possibly None once the generator has
been exhausted
gi_running set to 1 when generator is executing, 0 otherwise
next return the next item from the container
send resumes the generator and "sends" a value that becomes
the result of the current yield-expression
throw used to raise an exception inside the generator
isgeneratorfunction(obj)
Return true if the object is a user-defined generator function.
Generator function objects provide the same attributes as functions.
See help(isfunction) for a list of attributes.
isgetsetdescriptor(object)
Return true if the object is a getset descriptor.
getset descriptors are specialized descriptors defined in extension
modules.
ismemberdescriptor(object)
Return true if the object is a member descriptor.
Member descriptors are specialized descriptors defined in extension
modules.
ismethod(object)
Return true if the object is an instance method.
ismethoddescriptor(object)
Return true if the object is a method descriptor.
But not if ismethod() or isclass() or isfunction() are true.
This is new in Python 2.2, and, for example, is true of int.__add__.
An object passing this test has a __get__ attribute but not a __set__
attribute, but beyond that the set of attributes varies. __name__ is
usually sensible, and __doc__ often is.
Methods implemented via descriptors that also pass one of the other
tests return false from the ismethoddescriptor() test, simply because
the other tests promise more -- you can, e.g., count on having the
__func__ attribute (etc) when an object passes ismethod().
ismethodwrapper(object)
Return true if the object is a method wrapper.
ismodule(object)
Return true if the object is a module.
isroutine(object)
Return true if the object is any kind of function or method.
istraceback(object)
Return true if the object is a traceback.
Traceback objects provide these attributes:
tb_frame frame object at this level
tb_lasti index of last attempted instruction in bytecode
tb_lineno current line number in Python source code
tb_next next inner traceback object (called by this level)
markcoroutinefunction(func)
Decorator to ensure callable is recognised as a coroutine function.
signature(obj, *, follow_wrapped=True, globals=None, locals=None, eval_str=False)
Get a signature object for the passed callable.
stack(context=1)
Return a list of records for the stack above the caller's frame.
trace(context=1)
Return a list of records for the stack below the current exception.
unwrap(func, *, stop=None)
Get the object wrapped by *func*.
Follows the chain of :attr:`__wrapped__` attributes returning the last
object in the chain.
*stop* is an optional callback accepting an object in the wrapper chain
as its sole argument that allows the unwrapping to be terminated early if
the callback returns a true value. If the callback never returns a true
value, the last object in the chain is returned as usual. For example,
:func:`signature` uses this to stop unwrapping if any object in the
chain has a ``__signature__`` attribute defined.
:exc:`ValueError` is raised if a cycle is encountered.
walktree(classes, children, parent)
Recursive helper function for getclasstree().
DATA
AGEN_CLOSED = 'AGEN_CLOSED'
AGEN_CREATED = 'AGEN_CREATED'
AGEN_RUNNING = 'AGEN_RUNNING'
AGEN_SUSPENDED = 'AGEN_SUSPENDED'
CORO_CLOSED = 'CORO_CLOSED'
CORO_CREATED = 'CORO_CREATED'
CORO_RUNNING = 'CORO_RUNNING'
CORO_SUSPENDED = 'CORO_SUSPENDED'
CO_ASYNC_GENERATOR = 512
CO_COROUTINE = 128
CO_GENERATOR = 32
CO_ITERABLE_COROUTINE = 256
CO_NESTED = 16
CO_NEWLOCALS = 2
CO_NOFREE = 64
CO_OPTIMIZED = 1
CO_VARARGS = 4
CO_VARKEYWORDS = 8
GEN_CLOSED = 'GEN_CLOSED'
GEN_CREATED = 'GEN_CREATED'
GEN_RUNNING = 'GEN_RUNNING'
GEN_SUSPENDED = 'GEN_SUSPENDED'
TPFLAGS_IS_ABSTRACT = 1048576
__all__ = ['AGEN_CLOSED', 'AGEN_CREATED', 'AGEN_RUNNING', 'AGEN_SUSPEN...
AUTHOR
('Ka-Ping Yee <ping@lfw.org>', 'Yury Selivanov <yselivanov@sprymix.com>')
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\inspect.py
dataclasses.is_dataclass
Python Library Documentation: function is_dataclass in module dataclasses
is_dataclass(obj)
Returns True if obj is a dataclass or an instance of a
dataclass.
dataclasses.itertools
Python Library Documentation: built-in module itertools
NAME
itertools - Functional tools for creating and using iterators.
DESCRIPTION
Infinite iterators:
count(start=0, step=1) --> start, start+step, start+2*step, ...
cycle(p) --> p0, p1, ... plast, p0, p1, ...
repeat(elem [,n]) --> elem, elem, elem, ... endlessly or up to n times
Iterators terminating on the shortest input sequence:
accumulate(p[, func]) --> p0, p0+p1, p0+p1+p2
batched(p, n) --> [p0, p1, ..., p_n-1], [p_n, p_n+1, ..., p_2n-1], ...
chain(p, q, ...) --> p0, p1, ... plast, q0, q1, ...
chain.from_iterable([p, q, ...]) --> p0, p1, ... plast, q0, q1, ...
compress(data, selectors) --> (d[0] if s[0]), (d[1] if s[1]), ...
dropwhile(predicate, seq) --> seq[n], seq[n+1], starting when predicate fails
groupby(iterable[, keyfunc]) --> sub-iterators grouped by value of keyfunc(v)
filterfalse(predicate, seq) --> elements of seq where predicate(elem) is False
islice(seq, [start,] stop [, step]) --> elements from
seq[start:stop:step]
pairwise(s) --> (s[0],s[1]), (s[1],s[2]), (s[2], s[3]), ...
starmap(fun, seq) --> fun(*seq[0]), fun(*seq[1]), ...
tee(it, n=2) --> (it1, it2 , ... itn) splits one iterator into n
takewhile(predicate, seq) --> seq[0], seq[1], until predicate fails
zip_longest(p, q, ...) --> (p[0], q[0]), (p[1], q[1]), ...
Combinatoric generators:
product(p, q, ... [repeat=1]) --> cartesian product
permutations(p[, r])
combinations(p, r)
combinations_with_replacement(p, r)
CLASSES
builtins.object
accumulate
batched
chain
combinations
combinations_with_replacement
compress
count
cycle
dropwhile
filterfalse
groupby
islice
pairwise
permutations
product
repeat
starmap
takewhile
zip_longest
class accumulate(builtins.object)
| accumulate(iterable, func=None, *, initial=None)
|
| Return series of accumulated sums (or other binary function results).
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class batched(builtins.object)
| batched(iterable, n)
|
| Batch data into tuples of length n. The last batch may be shorter than n.
|
| Loops over the input iterable and accumulates data into tuples
| up to size n. The input is consumed lazily, just enough to
| fill a batch. The result is yielded as soon as a batch is full
| or when the input iterable is exhausted.
|
| >>> for batch in batched('ABCDEFG', 3):
| ... print(batch)
| ...
| ('A', 'B', 'C')
| ('D', 'E', 'F')
| ('G',)
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class chain(builtins.object)
| chain(*iterables) --> chain object
|
| Return a chain object whose .__next__() method returns elements from the
| first iterable until it is exhausted, then elements from the next
| iterable, until all of the iterables are exhausted.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__(...)
| See PEP 585
|
| from_iterable(iterable, /)
| Alternative chain() constructor taking a single iterable argument that evaluates lazily.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class combinations(builtins.object)
| combinations(iterable, r)
|
| Return successive r-length combinations of elements in the iterable.
|
| combinations(range(4), 3) --> (0,1,2), (0,1,3), (0,2,3), (1,2,3)
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| __sizeof__(...)
| Returns size in memory, in bytes.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class combinations_with_replacement(builtins.object)
| combinations_with_replacement(iterable, r)
|
| Return successive r-length combinations of elements in the iterable allowing individual elements to have successive repeats.
|
| combinations_with_replacement('ABC', 2) --> ('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| __sizeof__(...)
| Returns size in memory, in bytes.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class compress(builtins.object)
| compress(data, selectors)
|
| Return data elements corresponding to true selector elements.
|
| Forms a shorter iterator from selected data elements using the selectors to
| choose the data elements.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class count(builtins.object)
| count(start=0, step=1)
|
| Return a count object whose .__next__() method returns consecutive values.
|
| Equivalent to:
| def count(firstval=0, step=1):
| x = firstval
| while 1:
| yield x
| x += step
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class cycle(builtins.object)
| cycle(iterable, /)
|
| Return elements from the iterable until it is exhausted. Then repeat the sequence indefinitely.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class dropwhile(builtins.object)
| dropwhile(predicate, iterable, /)
|
| Drop items from the iterable while predicate(item) is true.
|
| Afterwards, return every element until the iterable is exhausted.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class filterfalse(builtins.object)
| filterfalse(function, iterable, /)
|
| Return those items of iterable for which function(item) is false.
|
| If function is None, return the items that are false.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class groupby(builtins.object)
| groupby(iterable, key=None)
|
| make an iterator that returns consecutive keys and groups from the iterable
|
| iterable
| Elements to divide into groups according to the key function.
| key
| A function for computing the group category for each element.
| If the key function is not specified or is None, the element itself
| is used for grouping.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class islice(builtins.object)
| islice(iterable, stop) --> islice object
| islice(iterable, start, stop[, step]) --> islice object
|
| Return an iterator whose next() method returns selected values from an
| iterable. If start is specified, will skip all preceding elements;
| otherwise, start defaults to zero. Step defaults to one. If
| specified as another value, step determines how many values are
| skipped between successive calls. Works like a slice() on a list
| but returns an iterator.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class pairwise(builtins.object)
| pairwise(iterable, /)
|
| Return an iterator of overlapping pairs taken from the input iterator.
|
| s -> (s0,s1), (s1,s2), (s2, s3), ...
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class permutations(builtins.object)
| permutations(iterable, r=None)
|
| Return successive r-length permutations of elements in the iterable.
|
| permutations(range(3), 2) --> (0,1), (0,2), (1,0), (1,2), (2,0), (2,1)
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| __sizeof__(...)
| Returns size in memory, in bytes.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class product(builtins.object)
| product(*iterables, repeat=1) --> product object
|
| Cartesian product of input iterables. Equivalent to nested for-loops.
|
| For example, product(A, B) returns the same as: ((x,y) for x in A for y in B).
| The leftmost iterators are in the outermost for-loop, so the output tuples
| cycle in a manner similar to an odometer (with the rightmost element changing
| on every iteration).
|
| To compute the product of an iterable with itself, specify the number
| of repetitions with the optional repeat keyword argument. For example,
| product(A, repeat=4) means the same as product(A, A, A, A).
|
| product('ab', range(3)) --> ('a',0) ('a',1) ('a',2) ('b',0) ('b',1) ('b',2)
| product((0,1), (0,1), (0,1)) --> (0,0,0) (0,0,1) (0,1,0) (0,1,1) (1,0,0) ...
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| __sizeof__(...)
| Returns size in memory, in bytes.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class repeat(builtins.object)
| repeat(object [,times]) -> create an iterator which returns the object
| for the specified number of times. If not specified, returns the object
| endlessly.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __length_hint__(...)
| Private method returning an estimate of len(list(it)).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class starmap(builtins.object)
| starmap(function, iterable, /)
|
| Return an iterator whose values are returned from the function evaluated with an argument tuple taken from the given sequence.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class takewhile(builtins.object)
| takewhile(predicate, iterable, /)
|
| Return successive entries from an iterable as long as the predicate evaluates to true for each entry.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class zip_longest(builtins.object)
| zip_longest(iter1 [,iter2 [...]], [fillvalue=None]) --> zip_longest object
|
| Return a zip_longest object whose .__next__() method returns a tuple where
| the i-th element comes from the i-th iterable argument. The .__next__()
| method continues until the longest iterable in the argument sequence
| is exhausted and then it raises StopIteration. When the shorter iterables
| are exhausted, the fillvalue is substituted in their place. The fillvalue
| defaults to None or can be specified by a keyword argument.
|
| Methods defined here:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __reduce__(...)
| Return state information for pickling.
|
| __setstate__(...)
| Set state information for unpickling.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
FUNCTIONS
tee(iterable, n=2, /)
Returns a tuple of n independent iterators.
FILE
(built-in)
dataclasses.keyword
Python Library Documentation: module keyword
NAME
keyword - Keywords (from "Grammar/python.gram")
MODULE REFERENCE
https://docs.python.org/3.12/library/keyword.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
This file is automatically generated; please don't muck it up!
To update the symbols in this file, 'cd' to the top directory of
the python source tree and run:
PYTHONPATH=Tools/peg_generator python3 -m pegen.keywordgen Grammar/python.gram Grammar/Tokens Lib/keyword.py
Alternatively, you can run 'make regen-keyword'.
FUNCTIONS
iskeyword = __contains__(...) method of builtins.frozenset instance
x.__contains__(y) <==> y in x.
issoftkeyword = __contains__(...) method of builtins.frozenset instance
x.__contains__(y) <==> y in x.
DATA
__all__ = ['iskeyword', 'issoftkeyword', 'kwlist', 'softkwlist']
kwlist = ['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'aw...
softkwlist = ['_', 'case', 'match', 'type']
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\keyword.py
dataclasses.make_dataclass
Python Library Documentation: function make_dataclass in module dataclasses
make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False, module=None)
Return a new dynamically created dataclass.
The dataclass name will be 'cls_name'. 'fields' is an iterable
of either (name), (name, type) or (name, type, Field) objects. If type is
omitted, use the string 'typing.Any'. Field objects are created by
the equivalent of calling 'field(name, type [, Field-info])'.::
C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))
is equivalent to::
@dataclass
class C(Base):
x: 'typing.Any'
y: int
z: int = field(init=False)
For the bases and namespace parameters, see the builtin type() function.
The parameters init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only,
slots, and weakref_slot are passed to dataclass().
If module parameter is defined, the '__module__' attribute of the dataclass is
set to that value.
dataclasses.re
Python Library Documentation: package re
NAME
re - Support for regular expressions (RE).
MODULE REFERENCE
https://docs.python.org/3.12/library/re.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
This module provides regular expression matching operations similar to
those found in Perl. It supports both 8-bit and Unicode strings; both
the pattern and the strings being processed can contain null bytes and
characters outside the US ASCII range.
Regular expressions can contain both special and ordinary characters.
Most ordinary characters, like "A", "a", or "0", are the simplest
regular expressions; they simply match themselves. You can
concatenate ordinary characters, so last matches the string 'last'.
The special characters are:
"." Matches any character except a newline.
"^" Matches the start of the string.
"$" Matches the end of the string or just before the newline at
the end of the string.
"*" Matches 0 or more (greedy) repetitions of the preceding RE.
Greedy means that it will match as many repetitions as possible.
"+" Matches 1 or more (greedy) repetitions of the preceding RE.
"?" Matches 0 or 1 (greedy) of the preceding RE.
*?,+?,?? Non-greedy versions of the previous three special characters.
{m,n} Matches from m to n repetitions of the preceding RE.
{m,n}? Non-greedy version of the above.
"\\" Either escapes special characters or signals a special sequence.
[] Indicates a set of characters.
A "^" as the first character indicates a complementing set.
"|" A|B, creates an RE that will match either A or B.
(...) Matches the RE inside the parentheses.
The contents can be retrieved or matched later in the string.
(?aiLmsux) The letters set the corresponding flags defined below.
(?:...) Non-grouping version of regular parentheses.
(?P<name>...) The substring matched by the group is accessible by name.
(?P=name) Matches the text matched earlier by the group named name.
(?#...) A comment; ignored.
(?=...) Matches if ... matches next, but doesn't consume the string.
(?!...) Matches if ... doesn't match next.
(?<=...) Matches if preceded by ... (must be fixed length).
(?<!...) Matches if not preceded by ... (must be fixed length).
(?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
the (optional) no pattern otherwise.
The special sequences consist of "\\" and a character from the list
below. If the ordinary character is not on the list, then the
resulting RE will match the second character.
\number Matches the contents of the group of the same number.
\A Matches only at the start of the string.
\Z Matches only at the end of the string.
\b Matches the empty string, but only at the start or end of a word.
\B Matches the empty string, but not at the start or end of a word.
\d Matches any decimal digit; equivalent to the set [0-9] in
bytes patterns or string patterns with the ASCII flag.
In string patterns without the ASCII flag, it will match the whole
range of Unicode digits.
\D Matches any non-digit character; equivalent to [^\d].
\s Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
bytes patterns or string patterns with the ASCII flag.
In string patterns without the ASCII flag, it will match the whole
range of Unicode whitespace characters.
\S Matches any non-whitespace character; equivalent to [^\s].
\w Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
in bytes patterns or string patterns with the ASCII flag.
In string patterns without the ASCII flag, it will match the
range of Unicode alphanumeric characters (letters plus digits
plus underscore).
With LOCALE, it will match the set [0-9_] plus characters defined
as letters for the current locale.
\W Matches the complement of \w.
\\ Matches a literal backslash.
This module exports the following functions:
match Match a regular expression pattern to the beginning of a string.
fullmatch Match a regular expression pattern to all of a string.
search Search a string for the presence of a pattern.
sub Substitute occurrences of a pattern found in a string.
subn Same as sub, but also return the number of substitutions made.
split Split a string by the occurrences of a pattern.
findall Find all occurrences of a pattern in a string.
finditer Return an iterator yielding a Match object for each match.
compile Compile a pattern into a Pattern object.
purge Clear the regular expression cache.
escape Backslash all non-alphanumerics in a string.
Each function other than purge and escape can take an optional 'flags' argument
consisting of one or more of the following module constants, joined by "|".
A, L, and U are mutually exclusive.
A ASCII For string patterns, make \w, \W, \b, \B, \d, \D
match the corresponding ASCII character categories
(rather than the whole Unicode categories, which is the
default).
For bytes patterns, this flag is the only available
behaviour and needn't be specified.
I IGNORECASE Perform case-insensitive matching.
L LOCALE Make \w, \W, \b, \B, dependent on the current locale.
M MULTILINE "^" matches the beginning of lines (after a newline)
as well as the string.
"$" matches the end of lines (before a newline) as well
as the end of the string.
S DOTALL "." matches any character at all, including the newline.
X VERBOSE Ignore whitespace and comments for nicer looking RE's.
U UNICODE For compatibility only. Ignored for string patterns (it
is the default), and forbidden for bytes patterns.
This module also defines an exception 'error'.
PACKAGE CONTENTS
_casefix
_compiler
_constants
_parser
CLASSES
builtins.Exception(builtins.BaseException)
error
builtins.object
Match
Pattern
enum.IntFlag(builtins.int, enum.ReprEnum, enum.Flag)
RegexFlag
class Match(builtins.object)
| The result of re.match() and re.search().
| Match objects always have a boolean value of True.
|
| Methods defined here:
|
| __copy__(self, /)
|
| __deepcopy__(self, memo, /)
|
| __getitem__(self, key, /)
| Return self[key].
|
| __repr__(self, /)
| Return repr(self).
|
| end(self, group=0, /)
| Return index of the end of the substring matched by group.
|
| expand(self, /, template)
| Return the string obtained by doing backslash substitution on the string template, as done by the sub() method.
|
| group(...)
| group([group1, ...]) -> str or tuple.
| Return subgroup(s) of the match by indices or names.
| For 0 returns the entire match.
|
| groupdict(self, /, default=None)
| Return a dictionary containing all the named subgroups of the match, keyed by the subgroup name.
|
| default
| Is used for groups that did not participate in the match.
|
| groups(self, /, default=None)
| Return a tuple containing all the subgroups of the match, from 1.
|
| default
| Is used for groups that did not participate in the match.
|
| span(self, group=0, /)
| For match object m, return the 2-tuple (m.start(group), m.end(group)).
|
| start(self, group=0, /)
| Return index of the start of the substring matched by group.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__(...)
| See PEP 585
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| endpos
| The index into the string beyond which the RE engine will not go.
|
| lastgroup
| The name of the last matched capturing group.
|
| lastindex
| The integer index of the last matched capturing group.
|
| pos
| The index into the string at which the RE engine started looking for a match.
|
| re
| The regular expression object.
|
| regs
|
| string
| The string passed to match() or search().
class Pattern(builtins.object)
| Compiled regular expression object.
|
| Methods defined here:
|
| __copy__(self, /)
|
| __deepcopy__(self, memo, /)
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __repr__(self, /)
| Return repr(self).
|
| findall(self, /, string, pos=0, endpos=9223372036854775807)
| Return a list of all non-overlapping matches of pattern in string.
|
| finditer(self, /, string, pos=0, endpos=9223372036854775807)
| Return an iterator over all non-overlapping matches for the RE pattern in string.
|
| For each match, the iterator returns a match object.
|
| fullmatch(self, /, string, pos=0, endpos=9223372036854775807)
| Matches against all of the string.
|
| match(self, /, string, pos=0, endpos=9223372036854775807)
| Matches zero or more characters at the beginning of the string.
|
| scanner(self, /, string, pos=0, endpos=9223372036854775807)
|
| search(self, /, string, pos=0, endpos=9223372036854775807)
| Scan through string looking for a match, and return a corresponding match object instance.
|
| Return None if no position in the string matches.
|
| split(self, /, string, maxsplit=0)
| Split string by the occurrences of pattern.
|
| sub(self, /, repl, string, count=0)
| Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.
|
| subn(self, /, repl, string, count=0)
| Return the tuple (new_string, number_of_subs_made) found by replacing the leftmost non-overlapping occurrences of pattern with the replacement repl.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__(...)
| See PEP 585
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| flags
| The regex matching flags.
|
| groupindex
| A dictionary mapping group names to group numbers.
|
| groups
| The number of capturing groups in the pattern.
|
| pattern
| The pattern string from which the RE object was compiled.
class RegexFlag(enum.IntFlag)
| RegexFlag(*values)
|
| An enumeration.
|
| Method resolution order:
| RegexFlag
| enum.IntFlag
| builtins.int
| enum.ReprEnum
| enum.Flag
| enum.Enum
| builtins.object
|
| Methods defined here:
|
| __and__(self, other) from enum.Flag
|
| __format__(self, format_spec, /) from builtins.int
| Convert to a string according to format_spec.
|
| __invert__(self) from enum.Flag
|
| __new__(cls, value) from enum.Enum
| Create and return a new object. See help(type) for accurate signature.
|
| __or__(self, other) from enum.Flag
| Return self|value.
|
| __rand__ = __and__(self, other)
|
| __repr__ = global_flag_repr(self) from enum
| use module.flag_name instead of class.flag_name
|
| the module is the last module in case of a multi-module name
|
| __ror__ = __or__(self, other)
|
| __rxor__ = __xor__(self, other)
|
| __str__(self, /) from builtins.object
| Return str(self).
|
| __xor__(self, other) from enum.Flag
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| ASCII = re.ASCII
|
| DEBUG = re.DEBUG
|
| DOTALL = re.DOTALL
|
| IGNORECASE = re.IGNORECASE
|
| LOCALE = re.LOCALE
|
| MULTILINE = re.MULTILINE
|
| TEMPLATE = re.TEMPLATE
|
| UNICODE = re.UNICODE
|
| VERBOSE = re.VERBOSE
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.int:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| True if self else False
|
| __ceil__(...)
| Ceiling of an Integral returns itself.
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floor__(...)
| Flooring an Integral returns itself.
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getnewargs__(self, /)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __index__(self, /)
| Return self converted to an integer, if self is suitable for use as an index into a list.
|
| __int__(self, /)
| int(self)
|
| __le__(self, value, /)
| Return self<=value.
|
| __lshift__(self, value, /)
| Return self<<value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rlshift__(self, value, /)
| Return value<<self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __round__(...)
| Rounding an Integral returns itself.
|
| Rounding with an ndigits argument also returns an integer.
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rrshift__(self, value, /)
| Return value>>self.
|
| __rshift__(self, value, /)
| Return self>>value.
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __sizeof__(self, /)
| Returns size in memory, in bytes.
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(...)
| Truncating an Integral returns itself.
|
| as_integer_ratio(self, /)
| Return a pair of integers, whose ratio is equal to the original int.
|
| The ratio is in lowest terms and has a positive denominator.
|
| >>> (10).as_integer_ratio()
| (10, 1)
| >>> (-10).as_integer_ratio()
| (-10, 1)
| >>> (0).as_integer_ratio()
| (0, 1)
|
| bit_count(self, /)
| Number of ones in the binary representation of the absolute value of self.
|
| Also known as the population count.
|
| >>> bin(13)
| '0b1101'
| >>> (13).bit_count()
| 3
|
| bit_length(self, /)
| Number of bits necessary to represent self in binary.
|
| >>> bin(37)
| '0b100101'
| >>> (37).bit_length()
| 6
|
| conjugate(...)
| Returns self, the complex conjugate of any int.
|
| is_integer(self, /)
| Returns True. Exists for duck type compatibility with float.is_integer.
|
| to_bytes(self, /, length=1, byteorder='big', *, signed=False)
| Return an array of bytes representing an integer.
|
| length
| Length of bytes object to use. An OverflowError is raised if the
| integer is not representable with the given number of bytes. Default
| is length 1.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value. Default is to use 'big'.
| signed
| Determines whether two's complement is used to represent the integer.
| If signed is False and a negative integer is given, an OverflowError
| is raised.
|
| ----------------------------------------------------------------------
| Class methods inherited from builtins.int:
|
| from_bytes(bytes, byteorder='big', *, signed=False)
| Return the integer represented by the given array of bytes.
|
| bytes
| Holds the array of bytes to convert. The argument must either
| support the buffer protocol or be an iterable object producing bytes.
| Bytes and bytearray are examples of built-in objects that support the
| buffer protocol.
| byteorder
| The byte order used to represent the integer. If byteorder is 'big',
| the most significant byte is at the beginning of the byte array. If
| byteorder is 'little', the most significant byte is at the end of the
| byte array. To request the native byte order of the host system, use
| `sys.byteorder' as the byte order value. Default is to use 'big'.
| signed
| Indicates whether two's complement is used to represent the integer.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.int:
|
| denominator
| the denominator of a rational number in lowest terms
|
| imag
| the imaginary part of a complex number
|
| numerator
| the numerator of a rational number in lowest terms
|
| real
| the real part of a complex number
|
| ----------------------------------------------------------------------
| Methods inherited from enum.Flag:
|
| __contains__(self, other)
| Returns True if self has at least the same flags set as other.
|
| __iter__(self)
| Returns flags in definition order.
|
| __len__(self)
| Return the number of members (no aliases)
|
| ----------------------------------------------------------------------
| Methods inherited from enum.Enum:
|
| __dir__(self)
| Returns public methods and other interesting attributes.
|
| __init__(self, *args, **kwds)
| Initialize self. See help(type(self)) for accurate signature.
|
| __reduce_ex__(self, proto)
| Helper for pickle.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from enum.Enum:
|
| name
| The name of the Enum member.
|
| value
| The value of the Enum member.
|
| ----------------------------------------------------------------------
| Static methods inherited from enum.EnumType:
|
| __getitem__(name)
| Return the member matching `name`.
|
| ----------------------------------------------------------------------
| Readonly properties inherited from enum.EnumType:
|
| __members__
| Returns a mapping of member name->value.
|
| This mapping lists all enum members, including aliases. Note that this
| is a read-only view of the internal mapping.
class error(builtins.Exception)
| error(msg, pattern=None, pos=None)
|
| Exception raised for invalid regular expressions.
|
| Attributes:
|
| msg: The unformatted error message
| pattern: The regular expression pattern
| pos: The index in the pattern where compilation failed (may be None)
| lineno: The line corresponding to pos (may be None)
| colno: The column corresponding to pos (may be None)
|
| Method resolution order:
| error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, msg, pattern=None, pos=None) from re._constants.error
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object
|
| ----------------------------------------------------------------------
| Static methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) class method of builtins.Exception
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| add_note(...)
| Exception.add_note(note) --
| add a note to the exception
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
FUNCTIONS
compile(pattern, flags=0)
Compile a regular expression pattern, returning a Pattern object.
escape(pattern)
Escape special characters in a string.
findall(pattern, string, flags=0)
Return a list of all non-overlapping matches in the string.
If one or more capturing groups are present in the pattern, return
a list of groups; this will be a list of tuples if the pattern
has more than one group.
Empty matches are included in the result.
finditer(pattern, string, flags=0)
Return an iterator over all non-overlapping matches in the
string. For each match, the iterator returns a Match object.
Empty matches are included in the result.
fullmatch(pattern, string, flags=0)
Try to apply the pattern to all of the string, returning
a Match object, or None if no match was found.
match(pattern, string, flags=0)
Try to apply the pattern at the start of the string, returning
a Match object, or None if no match was found.
purge()
Clear the regular expression caches
search(pattern, string, flags=0)
Scan through string looking for a match to the pattern, returning
a Match object, or None if no match was found.
split(pattern, string, maxsplit=0, flags=0)
Split the source string by the occurrences of the pattern,
returning a list containing the resulting substrings. If
capturing parentheses are used in pattern, then the text of all
groups in the pattern are also returned as part of the resulting
list. If maxsplit is nonzero, at most maxsplit splits occur,
and the remainder of the string is returned as the final element
of the list.
sub(pattern, repl, string, count=0, flags=0)
Return the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in string by the
replacement repl. repl can be either a string or a callable;
if a string, backslash escapes in it are processed. If it is
a callable, it's passed the Match object and must return
a replacement string to be used.
subn(pattern, repl, string, count=0, flags=0)
Return a 2-tuple containing (new_string, number).
new_string is the string obtained by replacing the leftmost
non-overlapping occurrences of the pattern in the source
string by the replacement repl. number is the number of
substitutions that were made. repl can be either a string or a
callable; if a string, backslash escapes in it are processed.
If it is a callable, it's passed the Match object and must
return a replacement string to be used.
template(pattern, flags=0)
Compile a template pattern, returning a Pattern object, deprecated
DATA
A = re.ASCII
ASCII = re.ASCII
DOTALL = re.DOTALL
I = re.IGNORECASE
IGNORECASE = re.IGNORECASE
L = re.LOCALE
LOCALE = re.LOCALE
M = re.MULTILINE
MULTILINE = re.MULTILINE
NOFLAG = re.NOFLAG
S = re.DOTALL
U = re.UNICODE
UNICODE = re.UNICODE
VERBOSE = re.VERBOSE
X = re.VERBOSE
__all__ = ['match', 'fullmatch', 'search', 'sub', 'subn', 'split', 'fi...
VERSION
2.2.1
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\re\__init__.py
dataclasses.replace
Python Library Documentation: function replace in module dataclasses
replace(obj, /, **changes)
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage::
@dataclass(frozen=True)
class C:
x: int
y: int
c = C(1, 2)
c1 = replace(c, x=3)
assert c1.x == 3 and c1.y == 2
dataclasses.sys
Python Library Documentation: built-in module sys
NAME
sys
MODULE REFERENCE
https://docs.python.org/3.12/library/sys.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
DESCRIPTION
This module provides access to some objects used or maintained by the
interpreter and to functions that interact strongly with the interpreter.
Dynamic objects:
argv -- command line arguments; argv[0] is the script pathname if known
path -- module search path; path[0] is the script directory, else ''
modules -- dictionary of loaded modules
displayhook -- called to show results in an interactive session
excepthook -- called to handle any uncaught exception other than SystemExit
To customize printing in an interactive session or to install a custom
top-level exception handler, assign other functions to replace these.
stdin -- standard input file object; used by input()
stdout -- standard output file object; used by print()
stderr -- standard error object; used for error messages
By assigning other file objects (or objects that behave like files)
to these, it is possible to redirect all of the interpreter's I/O.
last_exc - the last uncaught exception
Only available in an interactive session after a
traceback has been printed.
last_type -- type of last uncaught exception
last_value -- value of last uncaught exception
last_traceback -- traceback of last uncaught exception
These three are the (deprecated) legacy representation of last_exc.
Static objects:
builtin_module_names -- tuple of module names built into this interpreter
copyright -- copyright notice pertaining to this interpreter
exec_prefix -- prefix used to find the machine-specific Python library
executable -- absolute path of the executable binary of the Python interpreter
float_info -- a named tuple with information about the float implementation.
float_repr_style -- string indicating the style of repr() output for floats
hash_info -- a named tuple with information about the hash algorithm.
hexversion -- version information encoded as a single integer
implementation -- Python implementation information.
int_info -- a named tuple with information about the int implementation.
maxsize -- the largest supported length of containers.
maxunicode -- the value of the largest Unicode code point
platform -- platform identifier
prefix -- prefix used to find the Python library
thread_info -- a named tuple with information about the thread implementation.
version -- the version of this interpreter as a string
version_info -- version information as a named tuple
dllhandle -- [Windows only] integer handle of the Python DLL
winver -- [Windows only] version number of the Python DLL
_enablelegacywindowsfsencoding -- [Windows only]
__stdin__ -- the original stdin; don't touch!
__stdout__ -- the original stdout; don't touch!
__stderr__ -- the original stderr; don't touch!
__displayhook__ -- the original displayhook; don't touch!
__excepthook__ -- the original excepthook; don't touch!
Functions:
displayhook() -- print an object to the screen, and save it in builtins._
excepthook() -- print an exception and its traceback to sys.stderr
exception() -- return the current thread's active exception
exc_info() -- return information about the current thread's active exception
exit() -- exit the interpreter by raising SystemExit
getdlopenflags() -- returns flags to be used for dlopen() calls
getprofile() -- get the global profiling function
getrefcount() -- return the reference count for an object (plus one :-)
getrecursionlimit() -- return the max recursion depth for the interpreter
getsizeof() -- return the size of an object in bytes
gettrace() -- get the global debug tracing function
setdlopenflags() -- set the flags to be used for dlopen() calls
setprofile() -- set the global profiling function
setrecursionlimit() -- set the max recursion depth for the interpreter
settrace() -- set the global debug tracing function
SUBMODULES
monitoring
FUNCTIONS
__breakpointhook__ = breakpointhook(...)
breakpointhook(*args, **kws)
This hook function is called by built-in breakpoint().
__displayhook__ = displayhook(object, /)
Print an object to sys.stdout and also save it in builtins._
__excepthook__ = excepthook(exctype, value, traceback, /)
Handle an exception by displaying it with a traceback on sys.stderr.
__unraisablehook__ = unraisablehook(unraisable, /)
Handle an unraisable exception.
The unraisable argument has the following attributes:
* exc_type: Exception type.
* exc_value: Exception value, can be None.
* exc_traceback: Exception traceback, can be None.
* err_msg: Error message, can be None.
* object: Object causing the exception, can be None.
activate_stack_trampoline(backend, /)
Activate stack profiler trampoline *backend*.
addaudithook(hook)
Adds a new audit hook callback.
audit(...)
audit(event, *args)
Passes the event to any audit hooks that are attached.
breakpointhook(...)
breakpointhook(*args, **kws)
This hook function is called by built-in breakpoint().
call_tracing(func, args, /)
Call func(*args), while tracing is enabled.
The tracing state is saved, and restored afterwards. This is intended
to be called from a debugger from a checkpoint, to recursively debug
some other code.
deactivate_stack_trampoline()
Deactivate the current stack profiler trampoline backend.
If no stack profiler is activated, this function has no effect.
displayhook(object, /)
Print an object to sys.stdout and also save it in builtins._
exc_info()
Return current exception information: (type, value, traceback).
Return information about the most recent exception caught by an except
clause in the current stack frame or in an older stack frame.
excepthook(exctype, value, traceback, /)
Handle an exception by displaying it with a traceback on sys.stderr.
exception()
Return the current exception.
Return the most recent exception caught by an except clause
in the current stack frame or in an older stack frame, or None
if no such exception exists.
exit(status=None, /)
Exit the interpreter by raising SystemExit(status).
If the status is omitted or None, it defaults to zero (i.e., success).
If the status is an integer, it will be used as the system exit status.
If it is another kind of object, it will be printed and the system
exit status will be one (i.e., failure).
get_asyncgen_hooks()
Return the installed asynchronous generators hooks.
This returns a namedtuple of the form (firstiter, finalizer).
get_coroutine_origin_tracking_depth()
Check status of origin tracking for coroutine objects in this thread.
get_int_max_str_digits()
Return the maximum string digits limit for non-binary int<->str conversions.
getallocatedblocks()
Return the number of memory blocks currently allocated.
getdefaultencoding()
Return the current default encoding used by the Unicode implementation.
getfilesystemencodeerrors()
Return the error mode used Unicode to OS filename conversion.
getfilesystemencoding()
Return the encoding used to convert Unicode filenames to OS filenames.
getprofile()
Return the profiling function set with sys.setprofile.
See the profiler chapter in the library manual.
getrecursionlimit()
Return the current value of the recursion limit.
The recursion limit is the maximum depth of the Python interpreter
stack. This limit prevents infinite recursion from causing an overflow
of the C stack and crashing Python.
getrefcount(object, /)
Return the reference count of object.
The count returned is generally one higher than you might expect,
because it includes the (temporary) reference as an argument to
getrefcount().
getsizeof(...)
getsizeof(object [, default]) -> int
Return the size of object in bytes.
getswitchinterval()
Return the current thread switch interval; see sys.setswitchinterval().
gettrace()
Return the global debug tracing function set with sys.settrace.
See the debugger chapter in the library manual.
getunicodeinternedsize()
Return the number of elements of the unicode interned dictionary
getwindowsversion()
Return info about the running version of Windows as a named tuple.
The members are named: major, minor, build, platform, service_pack,
service_pack_major, service_pack_minor, suite_mask, product_type and
platform_version. For backward compatibility, only the first 5 items
are available by indexing. All elements are numbers, except
service_pack and platform_type which are strings, and platform_version
which is a 3-tuple. Platform is always 2. Product_type may be 1 for a
workstation, 2 for a domain controller, 3 for a server.
Platform_version is a 3-tuple containing a version number that is
intended for identifying the OS rather than feature detection.
intern(string, /)
``Intern'' the given string.
This enters the string in the (global) table of interned strings whose
purpose is to speed up dictionary lookups. Return the string itself or
the previously interned string object with the same value.
is_finalizing()
Return True if Python is exiting.
is_stack_trampoline_active()
Return *True* if a stack profiler trampoline is active.
set_asyncgen_hooks(...)
set_asyncgen_hooks([firstiter] [, finalizer])
Set a finalizer for async generators objects.
set_coroutine_origin_tracking_depth(depth)
Enable or disable origin tracking for coroutine objects in this thread.
Coroutine objects will track 'depth' frames of traceback information
about where they came from, available in their cr_origin attribute.
Set a depth of 0 to disable.
set_int_max_str_digits(maxdigits)
Set the maximum string digits limit for non-binary int<->str conversions.
setprofile(...)
setprofile(function)
Set the profiling function. It will be called on each function call
and return. See the profiler chapter in the library manual.
setrecursionlimit(limit, /)
Set the maximum depth of the Python interpreter stack to n.
This limit prevents infinite recursion from causing an overflow of the C
stack and crashing Python. The highest possible limit is platform-
dependent.
setswitchinterval(interval, /)
Set the ideal thread switching delay inside the Python interpreter.
The actual frequency of switching threads can be lower if the
interpreter executes long sequences of uninterruptible code
(this is implementation-specific and workload-dependent).
The parameter must represent the desired switching delay in seconds
A typical value is 0.005 (5 milliseconds).
settrace(...)
settrace(function)
Set the global debug tracing function. It will be called on each
function call. See the debugger chapter in the library manual.
unraisablehook(unraisable, /)
Handle an unraisable exception.
The unraisable argument has the following attributes:
* exc_type: Exception type.
* exc_value: Exception value, can be None.
* exc_traceback: Exception traceback, can be None.
* err_msg: Error message, can be None.
* object: Object causing the exception, can be None.
DATA
__stderr__ = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='cp1...
__stdin__ = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8...
__stdout__ = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1...
api_version = 1013
argv = [r'f:\JoeyCodes\PyDocs\py_docs.py', '--worker', 'dataclasses', ...
base_exec_prefix = r'C:\Users\Youse\AppData\Local\Programs\Python\Pyth...
base_prefix = r'C:\Users\Youse\AppData\Local\Programs\Python\Python312...
builtin_module_names = ('_abc', '_ast', '_bisect', '_blake2', '_codecs...
byteorder = 'little'
copyright = 'Copyright (c) 2001-2023 Python Software Foundati...ematis...
dllhandle = 140727031824384
dont_write_bytecode = False
exec_prefix = r'C:\Users\Youse\AppData\Local\Programs\Python\Python312...
executable = r'C:\Users\Youse\AppData\Local\Programs\Python\Python312\...
flags = sys.flags(debug=0, inspect=0, interactive=0, opt...ding=0, saf...
float_info = sys.float_info(max=1.7976931348623157e+308, max_...epsilo...
float_repr_style = 'short'
hash_info = sys.hash_info(width=64, modulus=2305843009213693...iphash1...
hexversion = 51119856
implementation = namespace(name='cpython', cache_tag='cpython-312...as...
int_info = sys.int_info(bits_per_digit=30, sizeof_digit=4, ..._str_dig...
maxsize = 9223372036854775807
maxunicode = 1114111
meta_path = [<_distutils_hack.DistutilsMetaFinder object>, <class '_fr...
modules = {'__future__': <module '__future__' from 'C:\\Users\\Youse\\...
orig_argv = [r'C:\Users\Youse\AppData\Local\Programs\Python\Python312\...
path = [r'f:\JoeyCodes\PyDocs', r'C:\Users\Youse\AppData\Local\Program...
path_hooks = [<class 'zipimport.zipimporter'>, <function FileFinder.pa...
path_importer_cache = {r'C:\Users\Youse\AppData\Local\Programs\Python\...
platform = 'win32'
platlibdir = 'DLLs'
prefix = r'C:\Users\Youse\AppData\Local\Programs\Python\Python312'
pycache_prefix = None
stderr = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='cp1252'...
stdin = <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>
stdlib_module_names = frozenset({'__future__', '_abc', '_aix_support',...
stdout = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp1252'...
thread_info = sys.thread_info(name='nt', lock=None, version=None)
version = '3.12.6 (tags/v3.12.6:a4a2d2b, Sep 6 2024, 20:11:23) [MSC v...
version_info = sys.version_info(major=3, minor=12, micro=6, releaselev...
warnoptions = []
winver = '3.12'
FILE
(built-in)
dataclasses.types
Python Library Documentation: module types
NAME
types - Define names for built-in types that aren't directly accessible as a builtin.
MODULE REFERENCE
https://docs.python.org/3.12/library/types.html
The following documentation is automatically generated from the Python
source files. It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations. When in doubt, consult the module reference at the
location listed above.
CLASSES
builtins.object
builtins.NoneType
builtins.NotImplementedType
builtins.async_generator
builtins.builtin_function_or_method
builtins.cell
builtins.classmethod_descriptor
builtins.code
builtins.coroutine
builtins.ellipsis
builtins.frame
builtins.function
builtins.generator
builtins.getset_descriptor
builtins.mappingproxy
builtins.member_descriptor
builtins.method
builtins.method-wrapper
builtins.method_descriptor
builtins.module
builtins.traceback
builtins.wrapper_descriptor
DynamicClassAttribute
GenericAlias
SimpleNamespace
UnionType
AsyncGeneratorType = class async_generator(object)
| Methods defined here:
|
| __aiter__(self, /)
| Return an awaitable, that resolves in asynchronous iterator.
|
| __anext__(self, /)
| Return a value or raise StopAsyncIteration.
|
| __del__(...)
|
| __repr__(self, /)
| Return repr(self).
|
| __sizeof__(...)
| gen.__sizeof__() -> size of gen in memory, in bytes
|
| aclose(...)
| aclose() -> raise GeneratorExit inside generator.
|
| asend(...)
| asend(v) -> send 'v' in generator.
|
| athrow(...)
| athrow(value)
| athrow(type[,value[,tb]])
|
| raise exception in generator.
| the (type, val, tb) signature is deprecated,
| and may be removed in a future version of Python.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__(...)
| See PEP 585
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| ag_await
| object being awaited on, or None
|
| ag_code
|
| ag_frame
|
| ag_running
|
| ag_suspended
BuiltinFunctionType = class builtin_function_or_method(object)
| Built-in subclasses:
| builtin_method
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __self__
|
| __text_signature__
BuiltinMethodType = class builtin_function_or_method(object)
| Built-in subclasses:
| builtin_method
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __self__
|
| __text_signature__
CellType = class cell(object)
| Create a new cell object.
|
| contents
| the contents of the cell. If not specified, the cell will be empty,
| and
| further attempts to access its cell_contents attribute will
| raise a ValueError.
|
| Methods defined here:
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| cell_contents
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __hash__ = None
ClassMethodDescriptorType = class classmethod_descriptor(object)
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __objclass__
|
| __text_signature__
CodeType = class code(object)
| CodeType(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, codestring, constants, names, varnames, filename, name, qualname, firstlineno, linetable, exceptiontable, freevars=(), cellvars=(), /)
|
| Create a code object. Not for the faint of heart.
|
| Methods defined here:
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __repr__(self, /)
| Return repr(self).
|
| __sizeof__(...)
| Size of object in memory, in bytes.
|
| co_lines(...)
|
| co_positions(...)
|
| replace(self, /, **changes)
| Return a copy of the code object with new values for the specified fields.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| co_argcount
|
| co_cellvars
|
| co_code
|
| co_consts
|
| co_exceptiontable
|
| co_filename
|
| co_firstlineno
|
| co_flags
|
| co_freevars
|
| co_kwonlyargcount
|
| co_linetable
|
| co_lnotab
|
| co_name
|
| co_names
|
| co_nlocals
|
| co_posonlyargcount
|
| co_qualname
|
| co_stacksize
|
| co_varnames
CoroutineType = class coroutine(object)
| Methods defined here:
|
| __await__(self, /)
| Return an iterator to be used in await expression.
|
| __del__(...)
|
| __repr__(self, /)
| Return repr(self).
|
| __sizeof__(...)
| gen.__sizeof__() -> size of gen in memory, in bytes
|
| close(...)
| close() -> raise GeneratorExit inside coroutine.
|
| send(...)
| send(arg) -> send 'arg' into coroutine,
| return next iterated value or raise StopIteration.
|
| throw(...)
| throw(value)
| throw(type[,value[,traceback]])
|
| Raise exception in coroutine, return next iterated value or raise
| StopIteration.
| the (type, val, tb) signature is deprecated,
| and may be removed in a future version of Python.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| cr_await
| object being awaited on, or None
|
| cr_code
|
| cr_frame
|
| cr_origin
|
| cr_running
|
| cr_suspended
class DynamicClassAttribute(builtins.object)
| DynamicClassAttribute(fget=None, fset=None, fdel=None, doc=None)
|
| Route attribute access on a class to __getattr__.
|
| This is a descriptor, used to define attributes that act differently when
| accessed through an instance and through a class. Instance access remains
| normal, but access to an attribute through a class will be routed to the
| class's __getattr__ method; this is done by raising AttributeError.
|
| This allows one to have properties active on an instance, and have virtual
| attributes on the class with the same name. (Enum used this between Python
| versions 3.4 - 3.9 .)
|
| Subclass from this to use a different method of accessing virtual attributes
| and still be treated properly by the inspect module. (Enum uses this since
| Python 3.10 .)
|
| Methods defined here:
|
| __delete__(self, instance)
|
| __get__(self, instance, ownerclass=None)
|
| __init__(self, fget=None, fset=None, fdel=None, doc=None)
| Initialize self. See help(type(self)) for accurate signature.
|
| __set__(self, instance, value)
|
| deleter(self, fdel)
|
| getter(self, fget)
|
| setter(self, fset)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables
|
| __weakref__
| list of weak references to the object
EllipsisType = class ellipsis(object)
| Methods defined here:
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
FrameType = class frame(object)
| Methods defined here:
|
| __repr__(self, /)
| Return repr(self).
|
| __sizeof__(...)
| F.__sizeof__() -> size of F in memory, in bytes
|
| clear(...)
| F.clear(): clear most references held by the frame
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| f_back
|
| f_builtins
|
| f_code
|
| f_globals
|
| f_lasti
|
| f_lineno
|
| f_locals
|
| f_trace
|
| f_trace_lines
|
| f_trace_opcodes
FunctionType = class function(object)
| FunctionType(code, globals, name=None, argdefs=None, closure=None)
|
| Create a function object.
|
| code
| a code object
| globals
| the globals dictionary
| name
| a string that overrides the name from the code object
| argdefs
| a tuple that specifies the default argument values
| closure
| a tuple that supplies the bindings for free variables
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __annotations__
|
| __closure__
|
| __code__
|
| __defaults__
|
| __dict__
|
| __globals__
|
| __kwdefaults__
|
| __type_params__
GeneratorType = class generator(object)
| Methods defined here:
|
| __del__(...)
|
| __iter__(self, /)
| Implement iter(self).
|
| __next__(self, /)
| Implement next(self).
|
| __repr__(self, /)
| Return repr(self).
|
| __sizeof__(...)
| gen.__sizeof__() -> size of gen in memory, in bytes
|
| close(...)
| close() -> raise GeneratorExit inside generator.
|
| send(...)
| send(arg) -> send 'arg' into generator,
| return next yielded value or raise StopIteration.
|
| throw(...)
| throw(value)
| throw(type[,value[,tb]])
|
| Raise exception in generator, return next yielded value or raise
| StopIteration.
| the (type, val, tb) signature is deprecated,
| and may be removed in a future version of Python.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| gi_code
|
| gi_frame
|
| gi_running
|
| gi_suspended
|
| gi_yieldfrom
| object being iterated by yield from, or None
class GenericAlias(builtins.object)
| Represent a PEP 585 generic type
|
| E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __dir__(...)
| Default dir() implementation.
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __instancecheck__(...)
| Check if an object is an instance.
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mro_entries__(...)
|
| __ne__(self, value, /)
| Return self!=value.
|
| __or__(self, value, /)
| Return self|value.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __ror__(self, value, /)
| Return value|self.
|
| __subclasscheck__(...)
| Check if a class is a subclass.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __args__
|
| __origin__
|
| __parameters__
| Type variables in the GenericAlias.
|
| __typing_unpacked_tuple_args__
|
| __unpacked__
GetSetDescriptorType = class getset_descriptor(object)
| Methods defined here:
|
| __delete__(self, instance, /)
| Delete an attribute of instance.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __repr__(self, /)
| Return repr(self).
|
| __set__(self, instance, value, /)
| Set an attribute of instance to value.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __objclass__
LambdaType = class function(object)
| LambdaType(code, globals, name=None, argdefs=None, closure=None)
|
| Create a function object.
|
| code
| a code object
| globals
| the globals dictionary
| name
| a string that overrides the name from the code object
| argdefs
| a tuple that specifies the default argument values
| closure
| a tuple that supplies the bindings for free variables
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __annotations__
|
| __closure__
|
| __code__
|
| __defaults__
|
| __dict__
|
| __globals__
|
| __kwdefaults__
|
| __type_params__
MappingProxyType = class mappingproxy(object)
| Methods defined here:
|
| __contains__(self, key, /)
| Return bool(key in self).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __ior__(self, value, /)
| Return self|=value.
|
| __iter__(self, /)
| Implement iter(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __or__(self, value, /)
| Return self|value.
|
| __repr__(self, /)
| Return repr(self).
|
| __reversed__(...)
| D.__reversed__() -> reverse iterator
|
| __ror__(self, value, /)
| Return value|self.
|
| __str__(self, /)
| Return str(self).
|
| copy(...)
| D.copy() -> a shallow copy of D
|
| get(...)
| D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
|
| items(...)
| D.items() -> a set-like object providing a view on D's items
|
| keys(...)
| D.keys() -> a set-like object providing a view on D's keys
|
| values(...)
| D.values() -> an object providing a view on D's values
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| __class_getitem__(...)
| See PEP 585
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
MemberDescriptorType = class member_descriptor(object)
| Methods defined here:
|
| __delete__(self, instance, /)
| Delete an attribute of instance.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| __set__(self, instance, value, /)
| Set an attribute of instance to value.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __objclass__
MethodDescriptorType = class method_descriptor(object)
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __objclass__
|
| __text_signature__
MethodType = class method(object)
| MethodType(function, instance, /)
|
| Create a bound instance method object.
|
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __reduce__(self, /)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __func__
| the function (or other callable) implementing a method
|
| __self__
| the instance to which a method is bound
MethodWrapperType = class method-wrapper(object)
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __objclass__
|
| __self__
|
| __text_signature__
ModuleType = class module(object)
| ModuleType(name, doc=None)
|
| Create a module object.
|
| The name must be a string; the optional doc argument can have any type.
|
| Methods defined here:
|
| __dir__(...)
| __dir__() -> list
| specialized dir() implementation
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __annotations__
|
| __dict__
class NoneType(object)
| Methods defined here:
|
| __bool__(self, /)
| True if self else False
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class NotImplementedType(object)
| Methods defined here:
|
| __bool__(self, /)
| True if self else False
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
class SimpleNamespace(builtins.object)
| A simple attribute-based namespace.
|
| SimpleNamespace(**kwargs)
|
| Methods defined here:
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __gt__(self, value, /)
| Return self>value.
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __reduce__(...)
| Return state information for pickling
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __hash__ = None
TracebackType = class traceback(object)
| TracebackType(tb_next, tb_frame, tb_lasti, tb_lineno)
| --
|
| Create a new traceback object.
|
| Methods defined here:
|
| __dir__(...)
| Default dir() implementation.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs)
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| tb_frame
|
| tb_lasti
|
| tb_lineno
|
| tb_next
class UnionType(builtins.object)
| Represent a PEP 604 union type
|
| E.g. for int | str
|
| Methods defined here:
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __or__(self, value, /)
| Return self|value.
|
| __repr__(self, /)
| Return repr(self).
|
| __ror__(self, value, /)
| Return value|self.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __args__
|
| __parameters__
| Type variables in the types.UnionType.
WrapperDescriptorType = class wrapper_descriptor(object)
| Methods defined here:
|
| __call__(self, /, *args, **kwargs)
| Call self as a function.
|
| __get__(self, instance, owner=None, /)
| Return an attribute of instance, which is of type owner.
|
| __reduce__(...)
| Helper for pickle.
|
| __repr__(self, /)
| Return repr(self).
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __objclass__
|
| __text_signature__
FUNCTIONS
coroutine(func)
Convert regular generator function to a coroutine.
get_original_bases(cls, /)
Return the class's "original" bases prior to modification by `__mro_entries__`.
Examples::
from typing import TypeVar, Generic, NamedTuple, TypedDict
T = TypeVar("T")
class Foo(Generic[T]): ...
class Bar(Foo[int], float): ...
class Baz(list[str]): ...
Eggs = NamedTuple("Eggs", [("a", int), ("b", str)])
Spam = TypedDict("Spam", {"a": int, "b": str})
assert get_original_bases(Bar) == (Foo[int], float)
assert get_original_bases(Baz) == (list[str],)
assert get_original_bases(Eggs) == (NamedTuple,)
assert get_original_bases(Spam) == (TypedDict,)
assert get_original_bases(int) == (object,)
new_class(name, bases=(), kwds=None, exec_body=None)
Create a class object dynamically using the appropriate metaclass.
prepare_class(name, bases=(), kwds=None)
Call the __prepare__ method of the appropriate metaclass.
Returns (metaclass, namespace, kwds) as a 3-tuple
*metaclass* is the appropriate metaclass
*namespace* is the prepared class namespace
*kwds* is an updated copy of the passed in kwds argument with any
'metaclass' entry removed. If no kwds argument is passed in, this will
be an empty dict.
resolve_bases(bases)
Resolve MRO entries dynamically as specified by PEP 560.
DATA
__all__ = ['FunctionType', 'LambdaType', 'CodeType', 'MappingProxyType...
FILE
c:\users\youse\appdata\local\programs\python\python312\lib\types.py