[Python-Dev] PyObject_RichCompareBool identity shortcut (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Wed Apr 27 18:01:24 CEST 2011
- Previous message: [Python-Dev] PyObject_RichCompareBool identity shortcut
- Next message: [Python-Dev] PyObject_RichCompareBool identity shortcut
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Apr 28, 2011 at 1:43 AM, Alexander Belopolsky <alexander.belopolsky at gmail.com> wrote:
High performance applications that rely on non-reflexivity will still have an option of using ctypes.cfloat type or NumPy.
However, that's exactly the reason I don't see any reason to reverse course on having float() and Decimal() follow IEEE754 semantics, regardless of how irritating we may find those semantics to be.
Since we allow types to customise eq and ne with non-standard behaviour, if we want to permit any type to have a non-reflexive notion of equality, then we need to write our container types to enforce reflexivity when appropriate. Many of the builtin types already do this, by virtue of it being built in to RichCompareBool. It's now a matter of documenting that properly and updating the non-conformant types accordingly.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] PyObject_RichCompareBool identity shortcut
- Next message: [Python-Dev] PyObject_RichCompareBool identity shortcut
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]