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

Method replace

Lib/tarfile.py:976–1002  ·  view source on GitHub ↗

Return a deep copy of self with the given attributes replaced.

(self, *,
                name=_KEEP, mtime=_KEEP, mode=_KEEP, linkname=_KEEP,
                uid=_KEEP, gid=_KEEP, uname=_KEEP, gname=_KEEP,
                deep=True, _KEEP=_KEEP)

Source from the content-addressed store, hash-verified

974 return "<%s %r at %#x>" % (self.__class__.__name__,self.name,id(self))
975
976 def replace(self, *,
977 name=_KEEP, mtime=_KEEP, mode=_KEEP, linkname=_KEEP,
978 uid=_KEEP, gid=_KEEP, uname=_KEEP, gname=_KEEP,
979 deep=True, _KEEP=_KEEP):
980 """Return a deep copy of self with the given attributes replaced.
981 """
982 if deep:
983 result = copy.deepcopy(self)
984 else:
985 result = copy.copy(self)
986 if name is not _KEEP:
987 result.name = name
988 if mtime is not _KEEP:
989 result.mtime = mtime
990 if mode is not _KEEP:
991 result.mode = mode
992 if linkname is not _KEEP:
993 result.linkname = linkname
994 if uid is not _KEEP:
995 result.uid = uid
996 if gid is not _KEEP:
997 result.gid = gid
998 if uname is not _KEEP:
999 result.uname = uname
1000 if gname is not _KEEP:
1001 result.gname = gname
1002 return result
1003
1004 def get_info(self):
1005 """Return the TarInfo&#x27;s attributes as a dictionary.

Callers 15

conf.pyFile · 0.45
us_dst_rangeFunction · 0.45
dstMethod · 0.45
fromutcMethod · 0.45
glossary_searchFunction · 0.45
write_documentsMethod · 0.45
_reprFunction · 0.45
parse_pdb_commandFunction · 0.45
_highlightSyntaxMethod · 0.45
get_varnameFunction · 0.45
ciFunction · 0.45
copy_includesFunction · 0.45

Calls 1

copyMethod · 0.45

Tested by 2

_find_optionsMethod · 0.36
test_calc_piFunction · 0.36