Can't do a multiline assignment!
Diez B. Roggisch
deets at nospam.web.de
Fri Apr 18 03:28:37 EDT 2008
Michael Torrie schrieb:
> s0suk3 at gmail.com wrote:
>> You didn't really write that at the Python's interpreter, did you?
>> It's wrong. The way that would really go at the interpreter is like
>
> I did actually run it through the interpreter, but I didn't copy and
> past it to the e-mail. Thought that I saw this behavior, but clearly I
> must not have.
>
>> classvar1 and classvar2 might be class variables, but in they don't
>> work as they would in C++ or Java (like the ones you declare with the
>> 'static' modified).
>
> Still, it's not pythonic to define instance variables in this way, as
> far as I can tell.
I've seen & used that for quite a while. It is more clear to provide
defaults that way.
Diez
More information about the Python-list
mailing list