PEP 285: Adding a bool type
Alex Martelli
aleax at aleax.it
Tue Apr 9 04:48:36 EDT 2002
Bengt Richter wrote:
...
>>implementation. One can of course do much better than that:
>>
>> [x for x in (y,)][0]
>>
> Yes, I thought of that one too, while I was out ;-)
>
> I think that one is actually _more_ "horrid" ;-) Why? Because it depends
> on what IMO should _not_ work and my example depends on what reasonably
> IMO _should_ work (if optimization issues did not take practical
> precedence). IMO letting a binding side effect escape the scope of a list
> comprehension is a flaw (and I'm guessing that it will be fixed). In
Sorry [not really:-)] but your O (and mine) does not matter as much as
GvR's and the Language Reference Manual.
> contrast, locals() returns a purported dictionary of local bindings, and
> IMO it's reasonable to expect to be able to modify them through dictionary
> operations, unless warned off conspicously.
Ditto: the warning in the docs IS quite conspicuous.
> Or perhaps I should say was: I saw another post from Aahz, which said,
> """
> I define "assignment" in Python as being precisely equal to "=".
> """
> So that changes the ball game and clinches it. He's perfectly right,
He's wrong only in his choice of pronoun -- it's not _him_ defining
what terms means in Python, but the Language Reference manual.
I always prefer to mention binding and rebinding (the EFFECT of
what we're doing), but when I mention the _tool_ often used to
perform such effect I call it assignment when it is, only.
Alex
More information about the Python-list
mailing list