[Python-ideas] Membership of infinite iterators
Koos Zevenhoven
k7hoven at gmail.com
Wed Oct 18 15:09:09 EDT 2017
On Wed, Oct 18, 2017 at 9:24 PM, MRAB <python at mrabarnett.plus.com> wrote:
>
> The re module increments a counter on each iteration and checks for
> signals when the bottom 12 bits are 0.
>
> The regex module increments a 16-bit counter on each iteration and checks
> for signals when it wraps around to 0.
>
Then I'd say that's a great solution, except that `regex` probably
over-exaggerates the overhead of checking for signals, and that `re` module
for some strange reason wants to make an additional bitwise and.
-- Koos
--
+ Koos Zevenhoven + http://twitter.com/k7hoven +
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171018/a756527a/attachment-0001.html>
More information about the Python-ideas
mailing list