i had this idea -- since quoted literals can be prefixed by a letter
that alters their meaning, why not use the same semantics
with curly braces?
"hello" -- byte string literal
r"hello" -- unescaped byte string literal
u"hello" -- unicode string literal
{1:2, 3:4, 5:6} -- dict literal
s{1, 2, 3} -- set literal
{} -- empty dict literal
s{} - empty set literal
this is more explicit, as {1:2} as {1,2} are too similar imo, and also
solves the no-literal-for-empty-set issue that has been discussed
at length.
this should only be a slight change to the parser, and is a syntax
error today, so there shouldn't be any backward-compat issues.
it may look strange at first (at least it me), but it's just a matter of
getting used to -- it's not any stranger than u"hello"
-tomer
_______________________________________________
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