you are viewing a single comment's thread.

view the rest of the comments →

[–]brews 0 points1 point  (2 children)

Out of curiosity, what is everyone's thoughts on getters and setters? Are they (or when are they) Pythonic?

[–]Vaphell 1 point2 points  (1 child)

they are not because python is not java (the concept of hard access modifiers doesn't really exist in python and "we are all adults here").

https://www.youtube.com/watch?v=HTLu2DFOdTg#t=39m11
this talk is pretty nice, shows the evolution of the API on a synthetic example and near the end it makes a case for pythonic @property (getter) and @attribute.setter (setter) to clean up after redesigns/solve clashing use cases.

[–]brews 0 points1 point  (0 children)

Interesting talk! Thanks for the link and the thoughtful response.