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

Method __repr__

Lib/zipfile/__init__.py:496–516  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

494 self.compress_level = value
495
496 def __repr__(self):
497 result = ['<%s filename=%r' % (self.__class__.__name__, self.filename)]
498 if self.compress_type != ZIP_STORED:
499 result.append(' compress_type=%s' %
500 compressor_names.get(self.compress_type,
501 self.compress_type))
502 hi = self.external_attr >> 16
503 lo = self.external_attr & 0xFFFF
504 if hi:
505 result.append(' filemode=%r' % stat.filemode(hi))
506 if lo:
507 result.append(' external_attr=%#x' % lo)
508 isdir = self.is_dir()
509 if not isdir or self.file_size:
510 result.append(' file_size=%r' % self.file_size)
511 if ((not isdir or self.compress_size) and
512 (self.compress_type != ZIP_STORED or
513 self.file_size != self.compress_size)):
514 result.append(' compress_size=%r' % self.compress_size)
515 result.append('>')
516 return ''.join(result)
517
518 def FileHeader(self, zip64=None):
519 """Return the per-file header as a bytes object.

Callers

nothing calls this directly

Calls 4

is_dirMethod · 0.95
appendMethod · 0.45
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected