On Mon, Oct 15, 2012 at 3:12 PM, Mike Graham email@example.com wrote:
def __\u2295__(self, other):
Now *that's* pretty!
IMO it's essential that we add source code escapes. Imagine the one-liners this will allow!
def f(xs):\n\ttry:\n\t\treturn x.pop()\n\texcept ValueError\n\t\treturn None
Can we get this fix applied in Python 2.2 and up?
Yeah, this is how Java works, and it's one of the best features of the language, because any valid program can be expressed using ASCII only.
Of course, it means that there are going to be some edge cases. Like, now:
will be an invalid program, since the newline escape will be translated before the source is tokenized. But who does that? It's just a small price to pay for the big wins of having any program expressed in simple ASCII.
Mike _______________________________________________ Python-ideas mailing list Pythonfirstname.lastname@example.org http://mail.python.org/mailman/listinfo/python-ideas