Long names are doom ?

Tim Peters tim.one at home.com
Sun May 27 01:08:37 EDT 2001


[Chris Gonnerman]
> ...
> This points toward one of my few complaints against Python:
> the absolute restriction against using a reserved word as a
> variable name *even if it is unambiguous*.  In particular,
> the common poplib construction:
>
>     conn.pass_ = "password"
>
> would not be ambiguous to a human if it were:
>
>     conn.pass = "password"
>
> but the Python interpreter makes that impossible.
>
> I realize the reason is so that you don't have ambiguous
> constructs like:
>
>     class = 10
>
> but IMHO Python would be better if it were allowed for
> attribute access as here:
>
>     myobj.class = 10
>
> for instance.

Also in Guido's opinion.  In fact, he's asked for a volunteer to submit a
patch to enable this, following the same rules as Jython (which isn't as
picky as CPython about "keywords" in non-keyword contexts).  But, so far, no
volunteer.

get-famous-or-maybe-just-rich-ly y'rs  - tim





More information about the Python-list mailing list