[issue31108] add __contains__ for list_iterator (and others) for better performance

Sergey Fedoseev report at bugs.python.org
Wed Aug 2 14:53:46 EDT 2017


New submission from Sergey Fedoseev:

> python -mtimeit -s "l = list(range(100000))" "l[-1] in l"
1000 loops, best of 3: 1.34 msec per loop
> python -mtimeit -s "l = list(range(100000))" "l[-1] in iter(l)"                                
1000 loops, best of 3: 1.59 msec per loop

----------
messages: 299666
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: add __contains__ for list_iterator (and others) for better performance
type: performance

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31108>
_______________________________________


More information about the Python-bugs-list mailing list