You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many classes needlessly wrap attributes in @propertys, e.g.
classFoo(object):
def__init__(bar):
self._bar=bar@propertydefbar(self):
"""The current bar value"""returnself._bar
These should be replaced with plain old attributes.
While we're doing this, we should consider using the attrs library, which would let us remove some boilerplate code and provides AutoValue-style immutable value classes when we actually do want to protect certain attributes.
However, using attrs would mean adding a dependency on another third party library and making the code less readable (and more magical).
The text was updated successfully, but these errors were encountered:
Many classes needlessly wrap attributes in
@property
s, e.g.These should be replaced with plain old attributes.
While we're doing this, we should consider using the
attrs
library, which would let us remove some boilerplate code and provides AutoValue-style immutable value classes when we actually do want to protect certain attributes.However, using
attrs
would mean adding a dependency on another third party library and making the code less readable (and more magical).The text was updated successfully, but these errors were encountered: