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 Eric Lafontaine
Recipients Eric Lafontaine, christian.heimes, docs@python, ezio.melotti, mark.dickinson, nparikh, r.david.murray, vstinner
Date 2017-02-08.01:34:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486517685.55.0.986678037681.issue16011@psf.upfronthosting.co.za>
In-reply-to
Content
oh, I've got what you meant!

Proposed change :
For user-defined classes which define the __contains__() method, the in operator will convert to False "x in y" if y.__contains__(x) return False, 0 or None.  Otherwise, the in operator will return True for any other value being returned by y.__contains__(x).


Would that make more sense?
Regards,
Eric Lafontaine
History
Date User Action Args
2017-02-08 01:34:45Eric Lafontainesetrecipients: + Eric Lafontaine, mark.dickinson, vstinner, christian.heimes, ezio.melotti, r.david.murray, docs@python, nparikh
2017-02-08 01:34:45Eric Lafontainesetmessageid: <1486517685.55.0.986678037681.issue16011@psf.upfronthosting.co.za>
2017-02-08 01:34:45Eric Lafontainelinkissue16011 messages
2017-02-08 01:34:45Eric Lafontainecreate