diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-19 06:40:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-19 06:40:32 (GMT) |
commit | bdf6b910f9ea75609caee498a975af03b6d23f67 (patch) | |
tree | ac69902aaaeb9c2e0578181e911a36af201ea1a0 /Lib/tarfile.py | |
parent | c85a26628ceb9624c96c3064e8b99033c026d8a3 (diff) | |
download | cpython-bdf6b910f9ea75609caee498a975af03b6d23f67.zip cpython-bdf6b910f9ea75609caee498a975af03b6d23f67.tar.gz cpython-bdf6b910f9ea75609caee498a975af03b6d23f67.tar.bz2 |
bpo-29776: Use decorator syntax for properties. (#585)
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index c3777ff..2d702dd 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -761,17 +761,21 @@ class TarInfo(object): # In pax headers the "name" and "linkname" field are called # "path" and "linkpath". - def _getpath(self): + @property + def path(self): return self.name - def _setpath(self, name): + + @path.setter + def path(self, name): self.name = name - path = property(_getpath, _setpath) - def _getlinkpath(self): + @property + def linkpath(self): return self.linkname - def _setlinkpath(self, linkname): + + @linkpath.setter + def linkpath(self, linkname): self.linkname = linkname - linkpath = property(_getlinkpath, _setlinkpath) def __repr__(self): return "<%s %r at %#x>" % (self.__class__.__name__,self.name,id(self)) |