Skip to content

Allow Generators for vol.In#523

Merged
alecthomas merged 1 commit intoalecthomas:masterfrom
cdce8p:allow-generators
Jul 22, 2024
Merged

Allow Generators for vol.In#523
alecthomas merged 1 commit intoalecthomas:masterfrom
cdce8p:allow-generators

Conversation

@cdce8p
Copy link
Copy Markdown
Contributor

@cdce8p cdce8p commented Jul 19, 2024

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

Copy link
Copy Markdown

@farmio farmio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks.

Copy link
Copy Markdown
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks.

@alecthomas alecthomas merged commit a7a55f8 into alecthomas:master Jul 22, 2024
@cdce8p cdce8p deleted the allow-generators branch July 22, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants