Hi,
what is the correct way to define properties - which
variant does not give me pylint warnings?
all variants I tried gave me warnings.
pylint --version
pylint 0.21.1,
astng 0.20.1, common 0.50.3
Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5]
I tried
@apply
def nameid():
"""the name id of this player"""
def fget(self):
return Players.allIds[self.name]
return property(**locals())
and
def nameid():
"""the name id of this player"""
def fget(self):
return Players.allIds[self.name]
return property(**locals())
nameid = nameid()
and the 2.6 property getter/setters like @nameid.getter
--
Wolfgang
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects