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

MRAB python at mrabarnett.plus.com
Sun Oct 14 02:04:59 CEST 2012


On 2012-10-14 00:42, Greg Ewing wrote:
> Mike Meyer wrote:
>
>> def __$<op>__(self, other, right):
>>
>> <op> must match a new grammer symbol "operator_symbol", with limits on
>> it to for readability reasons: say at most three characters, all
>> coming from an appropriate unicode class or classes
>
> If it's restricted it to single Unicode character, we could
> use its Unicode name as the method name:
>
> def __CIRCLE_PLUS__(x, y):
>      ...
>
If it's more than one codepoint, we could prefix with the length of the
codepoint's name:

def __12CIRCLED_PLUS__(x, y):
     ...




More information about the Python-ideas mailing list