[Tim] > Does it make sense to deprecate divmod() and // for complex numbers while > leaving % intact? [GvR] It doesn't, and I've repaired this. [GvR] However, I'm wondering what to do after we unify all numeric types (*if* we ever decide to do that, which isn't clear). At that point, should these operators be allowed as long as the imaginary part is zero? [RDH] Yes. Ideally, in a unified numeric model, all math operations should accept all numeric types and raise a domain exception (ValueError: math domain error) when an argument falls outside the defined scope just like we do for divide by zero, logs of negative numbers, and inverse trig functions which fall outside a defined domain. .real, .imag, and .conjugate() should be defined for integers and floats as well as complex numbers: (3).imag --> 0 Likewise, divmod() and // should work for complex numbers where the imaginary part is zero. Raymond Hettinger
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4