PEP238, syntax suggestion for floor division operator (not div)

average_python at safeadd.net average_python at safeadd.net
Mon Aug 6 17:20:20 EDT 2001


This is NOT a post debating whether or not PEP238 should be instantiated.

...rather, a (small) suggestion on the spelling for the new floor division
operator that does not seem to have been considered.

The current suggestion is to use '//'.  I instead suggest the 
backslash '\' for floor division for the following reasons:

1.  The backslash character has a natural "floor" mnemonic as it slopes to
the floor as read from left to right.

2.  Its name, "backslash", implies "backwards".  "Backwards" here, besides
the (appropriate) perjorative meaning, can also connote
"backwards-compatible"; i.e. classic Python division.

3.  No three-character operators: '\=' instead of '//='

My apologies if this has been discussed.  Google can't seem to search for
operators...

Thanks,

--mj

Still love ya...





More information about the Python-list mailing list