durusmail: quixote-users: Accessor methods and ZODB
Accessor methods and ZODB
2004-03-25
2004-03-25
2004-03-26
2004-03-26
2004-03-26
Re: Accessor methods and ZODB
2004-03-26
Accessor methods and ZODB
Daniel Potter (Ars Analytica)
2004-03-25
One uses .set_x(y) to avoid typos which create a new
variable instead of doing the assignement intended.

In the case of Dulci (in particular the places that
use ZODB) the use the .set_x(y) formalism to allows
one to do some type checking.

My guess is that the .get_x() formalism is used simply
to match the .set_x(y) formalism.


--- John J Lee  wrote:
> Dulcinea and its example app, Toboso, seem to
> consistently use accessor
> methods .get_x() / .set_x(y), in place of the
> popular Python convention of
> just using 'direct' attribute access .x / .x = y.
>
> Why is this done?  Is it a hold-over from older
> versions of the ZODB, or
> is there some current reason for it?
>
> I've followed this convention in my own code, but
> mostly out of paranoia.
>
>
> John
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
>
http://mail.mems-exchange.org/mailman/listinfo/quixote-users



reply