Modify ↓
Ticket #238 (new defect)
Opened 15 months ago
objects which have type checks in __eq__ or __cmp__ break serialization
| Reported by: | ccx@… | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Python classes that raise exceptions on comparison (== operator) may break the serialization as yaml/representer.py:142 contains:
if data in [None, ()]:
It should instead read:
if data is None or data is ():
to avoid invoking the class-defined comparison operations and check for object identity instead.
This currently breaks serialization of numpy.Array classes.
Attachments
Note: See
TracTickets for help on using
tickets.
