MCPcopy Index your code
hub / github.com/RustPython/RustPython / replace

Method replace

Lib/tarfile.py:978–1004  ·  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

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

Callers 15

runFunction · 0.45
_quoteMethod · 0.45
_fixmonthsFunction · 0.45
__calc_date_timeMethod · 0.45
__init__Method · 0.45
_strptimeFunction · 0.45
currencyFunction · 0.45
delocalizeFunction · 0.45
_replace_encodingFunction · 0.45
normalizeFunction · 0.45
locale.pyFile · 0.45
escape_encodeFunction · 0.45

Calls 1

copyMethod · 0.45

Tested by 2

_find_optionsMethod · 0.36
create_test_functionFunction · 0.36