MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / replace

Method replace

tools/python-3.11.9-amd64/Lib/tarfile.py:925–951  ·  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

923 return "<%s %r at %#x>" % (self.__class__.__name__,self.name,id(self))
924
925 def replace(self, *,
926 name=_KEEP, mtime=_KEEP, mode=_KEEP, linkname=_KEEP,
927 uid=_KEEP, gid=_KEEP, uname=_KEEP, gname=_KEEP,
928 deep=True, _KEEP=_KEEP):
929 """Return a deep copy of self with the given attributes replaced.
930 """
931 if deep:
932 result = copy.deepcopy(self)
933 else:
934 result = copy.copy(self)
935 if name is not _KEEP:
936 result.name = name
937 if mtime is not _KEEP:
938 result.mtime = mtime
939 if mode is not _KEEP:
940 result.mode = mode
941 if linkname is not _KEEP:
942 result.linkname = linkname
943 if uid is not _KEEP:
944 result.uid = uid
945 if gid is not _KEEP:
946 result.gid = gid
947 if uname is not _KEEP:
948 result.uname = uname
949 if gname is not _KEEP:
950 result.gname = gname
951 return result
952
953 def get_info(self):
954 """Return the TarInfo&#x27;s attributes as a dictionary.

Callers 4

tar_filterFunction · 0.45
data_filterFunction · 0.45
gettarinfoMethod · 0.45
_extract_memberMethod · 0.45

Calls 2

deepcopyMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected