MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _new

Function _new

tools/python-3.11.9-amd64/Lib/ast.py:546–556  ·  view source on GitHub ↗
(cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

544 return type.__instancecheck__(cls, inst)
545
546def _new(cls, *args, **kwargs):
547 for key in kwargs:
548 if key not in cls._fields:
549 # arbitrary keyword arguments are accepted
550 continue
551 pos = cls._fields.index(key)
552 if pos < len(args):
553 raise TypeError(f"{cls.__name__} got multiple values for argument {key!r}")
554 if cls in _const_types:
555 return Constant(*args, **kwargs)
556 return Constant.__new__(cls, *args, **kwargs)
557
558class Num(Constant, metaclass=_ABC):
559 _fields = ('n',)

Callers

nothing calls this directly

Calls 2

indexMethod · 0.45
__new__Method · 0.45

Tested by

no test coverage detected