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

Method make

Lib/zipfile/_path/__init__.py:147–163  ·  view source on GitHub ↗

Given a source (filename or zipfile), return an appropriate CompleteDirs subclass.

(cls, source)

Source from the content-addressed store, hash-verified

145
146 @classmethod
147 def make(cls, source):
148 """
149 Given a source (filename or zipfile), return an
150 appropriate CompleteDirs subclass.
151 """
152 if isinstance(source, CompleteDirs):
153 return source
154
155 if not isinstance(source, zipfile.ZipFile):
156 return cls(source)
157
158 # Only allow for FastLookup when supplied zipfile is read-only
159 if 'r' not in source.mode:
160 cls = CompleteDirs
161
162 source.__class__ = cls
163 return source
164
165 @classmethod
166 def inject(cls, zf: zipfile.ZipFile) -> zipfile.ZipFile:

Callers 2

test_stringsMethod · 0.45
__init__Method · 0.45

Calls 1

clsClass · 0.50

Tested by 1

test_stringsMethod · 0.36