alecthomas / voluptuous

CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.
https://pypi.org/project/voluptuous
BSD 3-Clause "New" or "Revised" License
1.81k stars 219 forks source link

Allow Generators for vol.In #523

Closed cdce8p closed 1 month ago

cdce8p commented 1 month ago

While the use of Container for vol.In is correct, it's incompatible with Generator even though the ... in ... check works fine.

For objects that don’t define contains(), the membership test first tries iteration via iter()

Ref #518 https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes https://docs.python.org/3/reference/datamodel.html#object.__contains__

/CC @farmio