Python style of accessing bools?
Diez B. Roggisch
deetsNOSPAM at web.de
Thu Apr 15 10:10:42 EDT 2004
> In other words, do you use accessors or just access the variable directly?
As a lot of things in programming, its a matter of taste. Now I personally
think that using accessors that simply return the value without any
computation are useless, as python has no real concept of private/protected
members.
Now if someone needs to protect her members from unwanted access, IMHO
properties are the way to go.
And I don't like the overhead of defining additional accessors - they're
sort of clumsy and they don't allow for nice assignments like this:
foo.bar = <whatever>
--
Regards,
Diez B. Roggisch
More information about the Python-list
mailing list