MCPcopy
hub / github.com/python-attrs/attrs / inspect

Function inspect

src/attr/_next_gen.py:651–674  ·  view source on GitHub ↗

Inspect the class and return its effective build parameters. Warning: This feature is currently **experimental** and is not covered by our strict backwards-compatibility guarantees. Args: cls: The *attrs*-decorated class to inspect. Returns: The ef

(cls)

Source from the content-addressed store, hash-verified

649
650
651def inspect(cls):
652 """
653 Inspect the class and return its effective build parameters.
654
655 Warning:
656 This feature is currently **experimental** and is not covered by our
657 strict backwards-compatibility guarantees.
658
659 Args:
660 cls: The *attrs*-decorated class to inspect.
661
662 Returns:
663 The effective build parameters of the class.
664
665 Raises:
666 NotAnAttrsClassError: If the class is not an *attrs*-decorated class.
667
668 .. versionadded:: 25.4.0
669 """
670 try:
671 return cls.__dict__["__attrs_props__"]
672 except KeyError:
673 msg = f"{cls!r} is not an attrs-decorated class."
674 raise NotAnAttrsClassError(msg) from None

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected