Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bundle2.py @ 27879:52a4ad62b006
cleanup: use modern @property/@foo.setter property specification
We can use this now that we're 2.6+, and this is more idiomatic modern
Python.
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 16 Jan 2016 10:50:28 -0500 |
parents | a40e2f7fe49d |
children | 88609cfa3745 |
line wrap: on
line diff
--- a/mercurial/bundle2.py Fri Jan 15 16:16:25 2016 +0100 +++ b/mercurial/bundle2.py Sat Jan 16 10:50:28 2016 -0500 @@ -851,13 +851,15 @@ self._advisoryparams, self._data, self.mandatory) # methods used to defines the part content - def __setdata(self, data): + @property + def data(self): + return self._data + + @data.setter + def data(self, data): if self._generated is not None: raise error.ReadOnlyPartError('part is being generated') self._data = data - def __getdata(self): - return self._data - data = property(__getdata, __setdata) @property def mandatoryparams(self):