[issue18032] set methods should specify whether they consume iterators "lazily"

Dustin Haffner report at bugs.python.org
Tue Nov 19 20:19:32 CET 2013


Dustin Haffner added the comment:

I've made an attempt at patching set_issubset() to match the Python from Raymond's message. I've rearranged the set_issubset function so that it checks for a set/frozenset, dict, or iterable in that order. In the iterable case it will create a temporary set and add elements to it as it consumes them from the iterable, returning early when possible.

This is my first patch, please let me know how I may improve it!

----------
keywords: +patch
nosy: +dhaffner
Added file: http://bugs.python.org/file32706/issubset_improvement.patch

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


More information about the Python-bugs-list mailing list