[Python-3000] sets in P3K?

Alex Martelli aleaxit at gmail.com
Mon Apr 24 18:15:53 CEST 2006


On 4/24/06, Barry Warsaw <barry at python.org> wrote:
> On Mon, 2006-04-24 at 10:16 -0400, Greg Wilson wrote:
>
> > I'm sure we can work something out --- I agree, {} for empty set and {:}
> > for empty dict would be ideal, were it not for backward compatibility.
>
> I dunno, the more I write dict() and set() the more I kind of like them
> rather the literal alternatives (at least for the former).

I concur -- and I would add list(), too (e.g. to get a copy of
somelist's contents, i find list(somelist) *MUCH* more readable than
the traditional somelist[:]).

I'd love for py3k to focus on 'nailing down [some] builtin names'
enough to allow the compiler to specialize many cases of, e.g.,
dict(a=1,b=2) to make exactly the same bytecode as for {'a':1, 'b':2},
and so on -- I suspect that focusing efforts on that "nailing down"
would have much vaster benefits than focusing them on all sorts of
punctuation-heavy syntaxes.


Alex


More information about the Python-3000 mailing list