[Python-3000] Empty set and empty dictionary (original) (raw)
Chris Rebert cvrebert at gmail.com
Tue Apr 17 03:08:22 CEST 2007
- Previous message: [Python-3000] Empty set and empty dictionary
- Next message: [Python-3000] Empty set and empty dictionary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I think someone has probably proposed this before, but why not use "{,}" as the empty set literal? It's somewhat analogous to the 1-element tuple syntax and fairly similar to the syntax that the original set PEP proposed ("{-}"). From what I understand, {-} was nixed for being too hard to parse because the minus sign could be the start of an expression. I don't think this would apply to the comma as it's basically used as an expression separator; however I'm no expert on Python's grammar and parser, so I can't be sure.
Thoughts?
- Chris Rebert
Eoghan Murray wrote:
I had another idea on this theme.. going by unicode and raw string literals, how about s[1, 2, 3, 4] for a set?
Eoghan On 17/04/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
DillonCo wrote: > Why not use "<>" for sets? Some possible reasons: * It would look ugly * There could be visual confusion with comparison operators * There could be parsing difficulties distinguishing nested set bracketing from << and >> operators -- Greg
Python-3000 mailing list Python-3000 at python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/eoghan%40qatano.com
------------------------------------------------------------------------
Python-3000 mailing list Python-3000 at python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/cvrebert%40gmail.com
- Previous message: [Python-3000] Empty set and empty dictionary
- Next message: [Python-3000] Empty set and empty dictionary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]