pydoc > _py_abc

📛 NAME

_py_abc

🚀 Quick Reference

Use CaseCommandDescription
Create an Abstract Base Classclass MyABC(metaclass=ABCMeta):Define a new ABC using ABCMeta as metaclass
Register a virtual subclassMyABC.register(SomeClass)Make SomeClass a virtual subclass of MyABC
Check instance (including virtual)isinstance(obj, MyABC)Override __instancecheck__ for virtual subclasses
Check subclass (including virtual)issubclass(SomeClass, MyABC)Override __subclasscheck__ for virtual subclasses
Get ABC cache tokenget_cache_token()Opaque token that changes on every register() call

📚 MODULE REFERENCE

https://docs.python.org/3.10/library/_py_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.type(builtins.object) → ABCMeta

📦 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:

⚡ Static methods defined here:

📊 Data and other attributes defined here:

🔄 Methods inherited from builtins.type:

🏛️ Class methods inherited from builtins.type:

📋 Data descriptors inherited from builtins.type:

📦 Data and other attributes inherited from builtins.type:

⚙️ FUNCTIONS

🔖 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.

📁 FILE

/usr/lib/python3.10/_py_abc.py

_py_abc
📛 NAME 🚀 Quick Reference 📚 MODULE REFERENCE 🏗️ CLASSES
📦 class ABCMeta(builtins.type)
⚙️ FUNCTIONS
🔖 get_cache_token()
📁 FILE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 12:14 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^