On 4/25/06, Terry Reedy <[EMAIL PROTECTED]> wrote:
> I can see an argument that the appropriate
> response to more types is a compensating decrease in syntax
> (as in dropping [xx] as a synonym for list(xx)) rather than adding
> more.

Great.  Except then how would you create a collection in the first place?

Right now, I use the awkward

    set(["asdf", "asdf2"])

    set(list("asdf", "asdf2"))    #syntax error
    set(tuple("asdf", "asdf2"))    #syntax error

    set(tuple(("asdf", "asdf2")))  # just add parens?  Or does that go too?

We need at least one literal for sequences.  We currently have list
(ordered, mutable), tuple (ordered, immutable), and dict (unordered,
mutable, associative).

The question is whether we should also have one for unordered
collections.  This is the datatype that we really want for most "x in
y" tests, but getting rid of the extra information may not be
important enough to use up literals.

-jJ
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to