Re: Assignment-in-conditional



On 2006-08-31, Fredrik Lundh <fredrik@xxxxxxxxxxxxxx> wrote:
xamdam wrote:

I am not sure if this came up before, but I would love to have an
'assignment-in-conditional' form in python, e.g

it's a FAQ, so it has probably come up before:

http://pyfaq.infogami.com/why-can-t-i-use-an-assignment-in-an-expression

Python saves me from ever making the assignment-as-conditional
mistake, but I invented the conditional-as-assignment mistake to
compensate.

--
Neil Cerutti
A billion here, a billion there, sooner or later it adds up to
real money. --Everett Dirksen
.



Relevant Pages

  • Re: [Python-Dev] The baby and the bathwater (Re: Scoping, augmented assignment, fast locals &#
    ... Python 3.x development has started already, so it's not so much a "fairy ... of your approach when using the Python programming language. ... the mistake I mention, both in personal code, as well as code I was ... Nobody forces any school to present closures to beginners. ...
    (comp.lang.python)
  • Re: initializing mutable class attributes
    ... I've done my share of Python teaching, ... that is probably a mistake ... I may not have enough experience with beginners, I guess -- my wife, ... have such a constructor, C++'s and Java's rules are nothing BUT overhead ...
    (comp.lang.python)
  • Re: The Industry choice
    ... your mistake quickly, and you know exactly where it is. ... In perl, I always use "use strict", but in Python, I just don't feel the ... use Pychecker, but if I was doing production code, I would probably use ...
    (comp.lang.python)
  • Re: Yum problem after update on FC-3
    ... > This looks a lot like a rawhide mirror to me... ... _after_ upgrading to FC-3. ... I'm perfectly willing to believe I made a mistake; ... I'll wait patiently for a new version of python to come out. ...
    (Fedora)
  • Re: Typed Python?
    ... >> big mistake to assume that Python displays any readability. ... But as an advocate of the potential of Python in education, ... "Programming a computer requires patience and concentration. ...
    (comp.lang.python)