Can't do a multiline assignment!

colas.francis at gmail.com colas.francis at gmail.com
Thu Apr 17 17:54:07 CEST 2008


On 17 avr, 17:40, s0s... at gmail.com wrote:
> > Yuck!  No way!!  If you *want* to make your code that hard to read, I'm
> > sure you can find lots of ways to do so, even in Python, but don't
> > expect Python to change to help you toward such a dubious goal.
>
> Well, my actual code doesn't look like that. Trust me, I like clean
> code.
>
> > Seriously, examine your motivations for wanting such a syntax.   Does it
> > make the code more readable?  (Absolutely not.)  Does it make it more
> > maintainable.  (Certainly not -- consider it you needed to change
> > CONSTANT2 to a different value some time in the future.)
>
> Yes, it makes it more readable. And yes, it does make it (a lot) more
> maintainable. Mainly because I don't have those four variables, I have
> about thirty. And I think I won't need to one or two of them, but
> maybe all of them at once.

Out of sheer curiosity, why do you need thirty (hand-specified and
dutifully commented) names to the same constant object if you know
there will always be only one object?



More information about the Python-list mailing list