Modify

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:
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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
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'
Author


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

 
Note: See TracTickets for help on using tickets.