MCPcopy Create free account
hub / github.com/numpy/numpy / __repr__

Method __repr__

numpy/lib/npyio.py:268–279  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 return (key in self._files or key in self.files)
267
268 def __repr__(self):
269 # Get filename or default to `object`
270 if isinstance(self.fid, str):
271 filename = self.fid
272 else:
273 filename = getattr(self.fid, "name", "object")
274
275 # Get the name of arrays
276 array_names = ', '.join(self.files[:self._MAX_REPR_ARRAY_COUNT])
277 if len(self.files) > self._MAX_REPR_ARRAY_COUNT:
278 array_names += "..."
279 return f"NpzFile {filename!r} with keys: {array_names}"
280
281
282@set_module('numpy')

Callers 1

random.pyFile · 0.45

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected