[Python-ideas] Is there a good reason to use * for multiplication?

Steven D'Aprano steve at pearwood.info
Tue Oct 16 02:17:52 CEST 2012


Deliberately not naming names, 'cos this isn't intended as a personal
attack on anyone...

Some people suggested as syntax:

>>>> def __12CIRCLED_PLUS__(x, y):
>>>>      ...

>>> def \u2295(x, y):
>>>      ....

>> def __\u2295__(self, other):

> 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?

As much as I've been wetting yourselves from all the hilarity, I'm
afraid that I have to ask you all to stop. Competing to see who can
come up with the worst possible joke syntax gets *real old* fast.

Sorry to be a wet blanket spoiling the fun, but this list does
have a serious purpose, and it seems to me that sarcastically[1]
inventing deliberately awful syntax is off-topic. Or at least
off-putting.

Now I enjoy reading the occasional piece of obfuscated code or
syntax as much as the next guy, but there are limits, and I think
this thread passed them about a dozen posts back.

Believe it or not, there are good, reasonable reasons for wanting
more operators, and at least one serious PEP driven by real-world
needs:

http://www.python.org/dev/peps/pep-0225/

So can we please drop this thread unless you have a serious
suggestion that doesn't need to wait until Python 4?




[1] By all the gods, PLEASE don't tell me these proposals are meant
seriously!


-- 
Steven



More information about the Python-ideas mailing list