This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka, terry.reedy, vstinner
Date 2017-03-24.19:38:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490384327.12.0.396978949699.issue29838@psf.upfronthosting.co.za>
In-reply-to
Content
Mis-behaving classes have to be written in C. If the __len__ method in Python class returns a negative value, ValueError is raised in slot_sq_length().

PySequence_GetItem() already contains an assertion that sq_length returns negative value only when an exception is set. The patch just extends this to other cases of calling sq_length and mq_length.
History
Date User Action Args
2017-03-24 19:38:47serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, vstinner
2017-03-24 19:38:47serhiy.storchakasetmessageid: <1490384327.12.0.396978949699.issue29838@psf.upfronthosting.co.za>
2017-03-24 19:38:47serhiy.storchakalinkissue29838 messages
2017-03-24 19:38:47serhiy.storchakacreate