MCPcopy Index your code
hub / github.com/RustPython/RustPython / Any

Class Any

Lib/typing.py:588–603  ·  view source on GitHub ↗

Special type indicating an unconstrained type. - Any is compatible with every type. - Any assumed to have all methods. - All values assumed to be instances of Any. Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should

Source from the content-addressed store, hash-verified

586
587
588class Any(metaclass=_AnyMeta):
589 """Special type indicating an unconstrained type.
590
591 - Any is compatible with every type.
592 - Any assumed to have all methods.
593 - All values assumed to be instances of Any.
594
595 Note that all the above statements are true from the point of view of
596 static type checkers. At runtime, Any should not be used with instance
597 checks.
598 """
599
600 def __new__(cls, *args, **kwargs):
601 if cls is Any:
602 raise TypeError("Any cannot be instantiated")
603 return super().__new__(cls)
604
605
606@_SpecialForm

Callers 2

from_argsMethod · 0.85

Calls

no outgoing calls

Tested by 1