Runtime Utility Functions

types.get_original_bases()

Inspect original declared base entries before MRO entry resolution. Uses __orig_bases__ when available, otherwise __bases__. Useful for generic aliases.

Formal Syntax & Structure

python syntaxpython
types.get_original_bases(cls, /)

Parameters & Attributes

NameTypeDescription
clstypeClass whose original bases are requested.

Return Value

tuple

The tuple result described above.

Working Example

Example Snippetpython
import typesclass Numbers(list[int]): passprint(types.get_original_bases(Numbers))
Python Reference