[Python-Dev] Alternate notation for global variable assignments

Anthony Baxter anthony at interlink.com.au
Mon Oct 27 18:16:09 EST 2003


>>> Alex Martelli wrote
> On Monday 27 October 2003 11:55 pm, Zack Weinberg wrote:
>    ...
> > Somewhat warty suggestion: take lst[:var] to be a slice, but
> > lst[(:var)] to be a global variable reference.  And lst[:(:var)] to be
> > a slice on a global, etc. etc.
> 
> That would work -- and with the :: (rather than single :) stropping
> which Guido seems to prefer, too.  As long as ::name or
> scope::name are always (parenthesized) when not doing so
> would be ambiguous (same general rules as, say, for tuples),
> which in their case would seem to be "within brackets only",
> I think :: stropping would work fine -- and perhaps avoid some
> possible single-: ambiguity in dictionary display such as

Can I just say, as someone who's only been lightly following this 
thread, that the above :(: type stuff

a) looks incredibly ugly
b) gives absolutely no clue as to what it might mean
c) looks incredibly ugly.

There's already prior usage of the : in python for dictionaries, for
slices, but nothing at all like this. I'd really hope we don't end up
with something this awful looking in the stdlib. 

Speaking purely for myself, of course <wink>

(On the other hand, making the operator :( might be a subtle way of
pre-deprecating it)

Anthony
-- 
Anthony Baxter     <anthony at interlink.com.au>   
It's never too late to have a happy childhood.



More information about the Python-Dev mailing list