Future division patch available (PEP 238)

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sun Jul 22 20:13:18 CEST 2001


Sun, 22 Jul 2001 12:55:31 +0100, Stephen Horne <steve at lurking.demon.co.uk> pisze:

>>Why div= wouldn't work? (Lexed as two tokens.)
> 
> Because div doesn't exist as a keyword,

I meant: if it existed, it would be as easy to form augmnented
assignment syntax as for //. There might be other reasons to use //
instead of div, but augmented assignment is not a good argument,
because it works well with either.

IMHO div is more clear. It's used with this meaning in other languages.

> If you do add a capability like that, I'd propose $mod and $rem as
> new operators - modulo and remainder.

After a slight change that they don't introduce new keywords but turn
identifiers into operators, you did the same thing as Miranda did
over 10 years ago :-)  Haskell uses `mod` and `rem` syntax instead
of $mod and $rem. It works for all identifiers, possibly qualified
by a module name.

But Python already uses operators looking as identifiers: or, not,
is, in.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list