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 mark.dickinson
Recipients mark.dickinson, rhettinger, serhiy.storchaka, tim.peters, vstinner, wbolster
Date 2017-07-14.15:20:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500045659.02.0.813359318141.issue30907@psf.upfronthosting.co.za>
In-reply-to
Content
> On other hand, this optimization already is implemented for integers, strings, bytes and slices.

Probably for good reasons, though, that don't necessarily apply to general containers / other objects.

I can see the possible value for strings and bytes, where filtering on a particular value might involve a good number of `s == s` comparisons (especially given string interning). Similarly, I could believe that small integer caching means that `0 == 0` or `1 == 1` comparisons happen often enough to make the 'is' optimisation worth it. I'm a bit bemused by the slice case, though.
History
Date User Action Args
2017-07-14 15:20:59mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, vstinner, serhiy.storchaka, wbolster
2017-07-14 15:20:59mark.dickinsonsetmessageid: <1500045659.02.0.813359318141.issue30907@psf.upfronthosting.co.za>
2017-07-14 15:20:59mark.dickinsonlinkissue30907 messages
2017-07-14 15:20:58mark.dickinsoncreate