Y
Hacker News
new
|
ask
|
show
|
jobs
by
jgalt212
321 days ago
why not inside of __init__
self.accessed_keys = set()
instead of
@property def accessed_keys(self): return self._accessed_keys
1 comments
Jaxan
321 days ago
With the @property you only get the “getter” and not the “setter”.
link
eurleif
321 days ago
But that doesn't accomplish much, because you can still do: `d.accessed_keys.add('foo')`.
link
Jaxan
321 days ago
That’s right
link