Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

Marco Bizzarri marco.bizzarri at gmail.com
Fri Sep 5 01:12:31 EDT 2008


On Thu, Sep 4, 2008 at 7:15 PM, Timothy Grant <timothy.grant at gmail.com> wrote:
>
> I think the most obvious solution to the problem is effective unit
> tests. If you type "a.y =1" and have a test that asserts a.x == 1 then
> you would quite quickly discover that you made a typo.
>
>
> --
> Stand Fast,
> tjg. [Timothy Grant]
>

Right; that is one of the things I try to do to avoid this sort of problems.

-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/



More information about the Python-list mailing list