Re: [Python-3000] Set literal

2008-01-25 Thread Nick Coghlan
Guido van Rossum wrote: > On Jan 25, 2008 10:01 AM, Leif Walsh <[EMAIL PROTECTED]> wrote: >> On Jan 25, 2008 12:37 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: >>> The pipe char is ambiguous because is no direction. It was suggested and >>> rejected last year. >> Out of almost-pure devil's advoc

Re: [Python-3000] Set literal

2008-01-25 Thread Raymond Hettinger
> should the repr for a set be set({a, b, c}) > instead of set([a, b, c])? FWIW, running eval() on the repr is slower and less memory efficient with curly braces than with the square brackets. Also, it may be easily misread as meaning: set([frozenset([a, b, c])]). If the latter is intended, t

Re: [Python-3000] Set literal

2008-01-25 Thread Guido van Rossum
On Jan 25, 2008 4:58 PM, Ron Adam <[EMAIL PROTECTED]> wrote: > How about also removing the {} as an empty dictionary? Then both > dictionary and set literals will require at least one item to be valid.No > confusion, and {} is not allowed because it's ambiguous (to users) as to > weather it's a

Re: [Python-3000] Set literal

2008-01-25 Thread Ron Adam
Raymond Hettinger wrote: > P.S. A small side-benefit is it may put an end for interminable requests for > a {:} or {/} notation for empty sets. There's not much need for a literal > for a empty frozenset (use "not s" instead). How about also removing the {} as an empty dictionary? Then bo

Re: [Python-3000] Set literal

2008-01-25 Thread Adam Olsen
On Jan 25, 2008 12:52 PM, Collin Winter <[EMAIL PROTECTED]> wrote: > > On Jan 24, 2008 10:40 PM, Adam Olsen <[EMAIL PROTECTED]> wrote: > > On Jan 24, 2008 5:12 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > > Looking over the code base, frozensets are used rarely. > > > > So I don't think t

Re: [Python-3000] Set literal

2008-01-25 Thread Steven Bethard
On Jan 25, 2008 1:31 PM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > > I'm a -0.9 on this one. I really like that Python is powerful, but also a > great pedagogical language. > > I don't like that whereas before you could teach someone {} creates a dict, > but now you have to say {} creates a dic

Re: [Python-3000] Set literal

2008-01-25 Thread J. Cliff Dyer
I'm a -0.9 on this one. I really like that Python is powerful, but also a great pedagogical language. I don't like that whereas before you could teach someone {} creates a dict, but now you have to say {} creates a dict, if there are colons inside, or it's empty, but otherwise creates a frozenset.

Re: [Python-3000] Set literal

2008-01-25 Thread Collin Winter
On Jan 24, 2008 10:40 PM, Adam Olsen <[EMAIL PROTECTED]> wrote: > On Jan 24, 2008 5:12 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > Looking over the code base, frozensets are used rarely. > > > So I don't think this is warranted. > > > > There is no shortage for perfect use cases in the f

Re: [Python-3000] Set literal

2008-01-25 Thread Charles Merriam
> There are also « and », << and >> for those w/o UTF-8 support in their > mail client. On my keyboard the characters are available under [alt gr] > + y and x. Not elegant. It should look pretty. Code should look the same in all character encodings unless alternate codings for used for identifie

Re: [Python-3000] Set literal

2008-01-25 Thread Thomas Wouters
On Jan 25, 2008 10:01 AM, Leif Walsh <[EMAIL PROTECTED]> wrote: > On Jan 25, 2008 12:37 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > > The pipe char is ambiguous because is no direction. It was suggested and > > rejected last year. > > Out of almost-pure devil's advocacy, has <> been consider

Re: [Python-3000] Set literal

2008-01-25 Thread Thomas Wouters
On Jan 25, 2008 10:32 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Leif Walsh wrote: > > Out of almost-pure devil's advocacy, has <> been considered? My first > > instinct is that it would be ambiguous with less-than/greater-than, > > but if someone can convince me otherwise, might it work?

Re: [Python-3000] Set literal

2008-01-25 Thread Christian Heimes
Leif Walsh wrote: > Out of almost-pure devil's advocacy, has <> been considered? My first > instinct is that it would be ambiguous with less-than/greater-than, > but if someone can convince me otherwise, might it work? After all, > it's the only other balanced pair of punctuation I see on my keyb

Re: [Python-3000] Set literal

2008-01-25 Thread Guido van Rossum
On Jan 25, 2008 10:15 AM, nathan binkert <[EMAIL PROTECTED]> wrote: > > No, there are too many syntactic situations where this would make the > > grammar ambiguous or tortuous. We don't want to move beyond LL(1). > > (Apart from parsing indentation and nested parentheses, of course -- > > which act

Re: [Python-3000] Set literal

2008-01-25 Thread Guido van Rossum
On Jan 25, 2008 10:01 AM, Leif Walsh <[EMAIL PROTECTED]> wrote: > On Jan 25, 2008 12:37 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > > The pipe char is ambiguous because is no direction. It was suggested and > > rejected last year. > > Out of almost-pure devil's advocacy, has <> been considere

Re: [Python-3000] Set literal

2008-01-25 Thread Leif Walsh
On Jan 25, 2008 12:37 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > The pipe char is ambiguous because is no direction. It was suggested and > rejected last year. Out of almost-pure devil's advocacy, has <> been considered? My first instinct is that it would be ambiguous with less-than/greate

Re: [Python-3000] Ellipsis Literal

2008-01-25 Thread Guido van Rossum
On Jan 25, 2008 7:47 AM, Gisle Aas <[EMAIL PROTECTED]> wrote: > On Jan 24, 2008, at 20:32, Guido van Rossum wrote: > > > Some folks thought it would be cute to be able to write incomplete > > code like this: > > > > class C: > > def meth(self): ... > > ... > > > > and have it be syntactically c

Re: [Python-3000] Set literal

2008-01-25 Thread Christian Heimes
Dj Gilcrease wrote: > This probably will not go over well, but why not use the pipe > character to define a frozenset? > > if urltxt in |'html', 'xml', 'php'|: The pipe char is ambiguous because is no direction. It was suggested and rejected last year. Christian

Re: [Python-3000] Set literal

2008-01-25 Thread Dj Gilcrease
On Jan 24, 2008 8:12 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I hope it isn't too confusing that {1: 1} creates a *mutable* dict > while {1} creates an *immutable* frozenset. I still find this slightly > inelegant. But the practicality of being able to treat set literals as > compile-time

Re: [Python-3000] Set literal

2008-01-25 Thread Christian Heimes
Raymond Hettinger wrote: > I think it would be more useful for the {e1, e2, e3} literal to be a > frozenset instead of a set. +1 from me Christian ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000

Re: [Python-3000] Set literal

2008-01-25 Thread Nick Coghlan
Mark Summerfield wrote: > On 2008-01-25, Guido van Rossum wrote: >> For the record, I'm thinking Raymond has won this argument fair and >> square, and I'm withdrawing my opposition. >> >> I hope it isn't too confusing that {1: 1} creates a *mutable* dict >> while {1} creates an *immutable* frozense

Re: [Python-3000] Ellipsis Literal

2008-01-25 Thread Gisle Aas
On Jan 24, 2008, at 20:32, Guido van Rossum wrote: > Some folks thought it would be cute to be able to write incomplete > code like this: > > class C: > def meth(self): ... > ... > > and have it be syntactically correct. I think it would be been nice if "..." raised an NotYetImplemented exc

Re: [Python-3000] Set literal

2008-01-25 Thread Aahz
On Fri, Jan 25, 2008, Mark Summerfield wrote: > > Python 3 is going to break compatibility anyway. I thought one of the > purposes of having a new major release was to allow for such changes. > > In 2 or 3 years from now Python 3 will be "Python" for most people, and > confusing inconsistencies wo

Re: [Python-3000] Set literal

2008-01-25 Thread Gustavo Niemeyer
> I hope it isn't too confusing that {1: 1} creates a *mutable* dict > while {1} creates an *immutable* frozenset. I still find this slightly > inelegant. But the practicality of being able to treat set literals as > compile-time constants wins me over. Another point in favor of Raymond's suggest

Re: [Python-3000] Set literal

2008-01-25 Thread Christian Heimes
Mark Summerfield wrote: > Python 3 is going to break compatibility anyway. I thought one of the > purposes of having a new major release was to allow for such changes. Please stop the discussion! Guido already voted against it. I assume most of the remaining core developers agree with me that thre

Re: [Python-3000] Set literal

2008-01-25 Thread Marcin ‘Qrczak’ Kowalczyk
Dnia 25-01-2008, Pt o godzinie 07:18 +, Mark Summerfield pisze: > If you're going to make the change, why not make things consistent: How often do you need the empty frozenset (which will stay as such), compared to an empty dict (which will probably get filled later)? The real inconsistency

Re: [Python-3000] Set literal

2008-01-25 Thread Oleg Broytmann
On Fri, Jan 25, 2008 at 09:29:49AM +, Mark Summerfield wrote: > In 2 or 3 years from now Python 3 will be "Python" for most people It depends on how much it breaks. If Python 3 breaks too much people may find it is a completely new language and decide to switch to another language instead o

Re: [Python-3000] Set literal

2008-01-25 Thread Mark Summerfield
On 2008-01-25, Steven Bethard wrote: > On Jan 25, 2008 12:18 AM, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > On 2008-01-25, Guido van Rossum wrote: > > > For the record, I'm thinking Raymond has won this argument fair and > > > square, and I'm withdrawing my opposition. > > > > > > I hope it is