MCPcopy Index your code
hub / github.com/python/cpython / _new_instance

Method _new_instance

Lib/zoneinfo/_zoneinfo.py:66–79  ·  view source on GitHub ↗
(cls, key)

Source from the content-addressed store, hash-verified

64
65 @classmethod
66 def _new_instance(cls, key):
67 obj = super().__new__(cls)
68 obj._key = key
69 obj._file_path = obj._find_tzfile(key)
70
71 if obj._file_path is not None:
72 file_obj = open(obj._file_path, "rb")
73 else:
74 file_obj = _common.load_tzdata(key)
75
76 with file_obj as f:
77 obj._load_file(f)
78
79 return obj
80
81 @classmethod
82 def from_file(cls, file_obj, /, key=None):

Callers 2

__new__Method · 0.80
no_cacheMethod · 0.80

Calls 5

superClass · 0.85
_find_tzfileMethod · 0.80
_load_fileMethod · 0.80
openFunction · 0.50
__new__Method · 0.45

Tested by

no test coverage detected