Ticket #238 (new defect)

Opened 2 years 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:


Python classes that raise exceptions on comparison (== operator) may break the serialization as yaml/ 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.



Add a comment

Modify Ticket

Change Properties
<Author field>
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.