[SciPy-Dev] Code question about signal.ltisys.py

Warren Weckesser warren.weckesser at enthought.com
Tue May 22 06:05:20 EDT 2012


On Tue, May 22, 2012 at 4:11 AM, Pauli Virtanen <pav at iki.fi> wrote:

> Warren Weckesser <warren.weckesser <at> enthought.com> writes:
> [clip]
> > self.__dict__['num'], self.__dict__['den'] = normalize(*args)
> >
> > My inclination is to rewrite that as
> >
> > self.num, self.den = normalize(*args)
> >
> > But am I missing something?
>
> These lines are equivalent, *unless* the class has __setattr__ defined.
> That's the case here, so rewriting may end up in different behavior
> than intended, depending on what __setattr__ does.
>
>


Ah, right.  Thanks.

Warren




>    Pauli
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20120522/c460ca4a/attachment.html>


More information about the SciPy-Dev mailing list