Skip to content
Rob Nagler edited this page Aug 6, 2025 · 8 revisions

in consumes an iterable

For user-defined classes which do not define __contains__() but do define __iter__(), x in y is True if some value z, for which the expression x is z or x == z is true, is produced while iterating over y.

private note

Clone this wiki locally