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

Method _make

Lib/platform.py:946–953  ·  view source on GitHub ↗
(cls, iterable)

Source from the content-addressed store, hash-verified

944
945 @classmethod
946 def _make(cls, iterable):
947 # override factory to affect length check
948 num_fields = len(cls._fields) - 1
949 result = cls.__new__(cls, *iterable)
950 if len(result) != num_fields + 1:
951 msg = f'Expected {num_fields} arguments, got {len(result)}'
952 raise TypeError(msg)
953 return result
954
955 def __getitem__(self, key):
956 return tuple(self)[key]

Callers 6

_replaceFunction · 0.80
test_instanceMethod · 0.80
test_odd_sizesMethod · 0.80
test_large_sizeMethod · 0.80
test_name_conflictsMethod · 0.80

Calls 2

lenFunction · 0.85
__new__Method · 0.45

Tested by 4

test_instanceMethod · 0.64
test_odd_sizesMethod · 0.64
test_large_sizeMethod · 0.64
test_name_conflictsMethod · 0.64