Pep 238 Why new // operator (Non-integer Division)

Don Dwiggins dwig at advancedmp.net
Mon Mar 19 18:39:47 CET 2001


Tim Peters writes:
> [Alex Martelli]
>> So what's so terrible about non-infix notation, a builtin div(a,b) [and
>> mod(a,b) too since we're at it...?].  Sure, infix can be handy --

> Infix is also a speed issue in Python, since syntax is fixed but builtin
> names are not reserved; so the speed freaks will surely argue for syntax.

>> but then this might be the occasion to steal a leaf from Haskell's
>> book... let any 2-operand function be used as an infix operator
>> (possibly with some stropping if that is needed to disambiguate
>> syntax).

Many Prologs also have this capability, with a way to define prefix, infix,
and postfix operators, along with precedence values to determine grouping.

-- 
Don Dwiggins                    "Solvitur Ambulando"
Advanced MP Technology
dwig at advancedmp.net





More information about the Python-list mailing list