inspect — Inspect live objects — Python 3.14.7 documentation

docs.python.org

Tin mới

gc — Garbage Collector interface

annotationlib — Functionality for introspecting annotations

Python Module Index

3.14.7 Documentation

The Python Standard Library

Python Runtime Services

Import-related attributes on module objects

The getmembers() function retrieves the members of an object such as a class or module. The functions whose names begin with “is” are mainly provided as convenient choices for the second argument to getmembers(). They al

sys.set_coroutine_origin_tracking_depth()

where coroutine was created, or None. See sys.set_coroutine_origin_tracking_depth()

importlib.machinery.all_suffixes()

Return the name of the module named by the file path, without including the names of enclosing packages. The file extension is checked against all of the entries in importlib.machinery.all_suffixes(). If it matches, the

functools.partial()

Changed in version 3.8: Functions wrapped in functools.partial() now return True if the wrapped function is a Python generator function.

coroutine function

Return True if the object is a coroutine function (a function defined with an async def syntax), a functools.partial() wrapping a coroutine function, or a sync function marked with markcoroutinefunction().

types.MethodWrapperType

Return True if the type of object is a MethodWrapperType.

definition.__name__

Return True if the object is a method descriptor, but not if isclass(), ismethod() or isfunction() is true.

the FAQ entry on positional-only parameters

Accepts a wide range of Python callables, from plain functions and classes to functools.partial() objects.

collections.OrderedDict

Changed in version 3.9: arguments is now of type dict. Formerly, it was of type collections.OrderedDict.

Fetching attributes statically¶

Both getattr() and hasattr() can trigger code execution when fetching or checking for the existence of attributes. Descriptors, like properties, will be invoked and __getattr__() and __getattribute__() may be called.

Buffer request types

This is an enum.IntFlag that represents the flags that can be passed to the __buffer__() method of objects implementing the buffer protocol.