When do default parameters get their values set?

Chris Angelico rosuav at gmail.com
Wed Dec 10 21:24:05 EST 2014


On Thu, Dec 11, 2014 at 1:18 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> But I have a different question -- can this be demonstrated without the 'is'?
> Because to me 'is' -- equivalently id -- is a code-smell and is like
> explaining funny behavior by showing the dis -- like
> $ gcc -S ...
> -- output.
>
> It can always explain, but indicates that the semantics is not (sufficiently) abstract in this aspect

Not so. Object identity is a fundamental part of Python.
Indistinguishable-but-distinct mutable objects are crucial to Python's
behaviour.

ChrisA



More information about the Python-list mailing list