Le 09/07/2014 00:21, Stephen J. Turnbull a écrit : > Steven D'Aprano writes: > > > I don't think so. Floating point == represents *numeric* equality, > > There is no such thing as floating point == in Python. You can apply > == to two floating point numbers, but == (at the language level) > handles any two numbers, as well as pairs of things that aren't > numbers in the Python language. This is becoming pointless hair-splitting. >>> float.__eq__(1.0, 2.0) False >>> float.__eq__(1.0, 2) False >>> float.__eq__(1.0, 1.0+0J) NotImplemented >>> float.__eq__(1, 2) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: descriptor '__eq__' requires a 'float' object but received a 'int' Please direct any further discussion of this to python-ideas.
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