[Python-Dev] Re: [Python-checkins] python/dist/src/Objects complexobject.c,2.57,2.58 (original) (raw)

Tim Peters tim.one@comcast.net
Mon, 15 Apr 2002 00:33:16 -0400


""" Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv7877

Modified Files: complexobject.c Log Message: SF bug #543387.

Complex numbers implement divmod() and //, neither of which makes one lick of sense. Unfortunately this is documented, so I'm adding a deprecation warning now, so we can delete this silliness, oh, around 2005 or so.

Bugfix candidate (At least for 2.2.2, I think.) """

Does it make sense to deprecate divmod() and // for complex numbers while leaving % intact?

x % y == x - y * math.floor((x/y).real)

makes exactly as much sense to me (approximately none) as

x // y == math.floor((x/y).real)

made. Python's definitions of % and // make great sense for integral types, but they start to fall apart for floats, and complexes are right out.