Skip to content

Use typing.Container for In validator#518

Merged
alecthomas merged 1 commit intoalecthomas:masterfrom
cdce8p:in-container
Jun 25, 2024
Merged

Use typing.Container for In validator#518
alecthomas merged 1 commit intoalecthomas:masterfrom
cdce8p:in-container

Conversation

@cdce8p
Copy link
Contributor

@cdce8p cdce8p commented Jun 25, 2024

... in ... only requires __contains__. The In validator should therefore use Container instead of Iterable.

Refs home-assistant/core#120268
/CC @bdraco

https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes

@alecthomas alecthomas merged commit 4a610d3 into alecthomas:master Jun 25, 2024
@cdce8p cdce8p deleted the in-container branch June 25, 2024 22:15
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