Skip to content

Conversation

@randolf-scholz
Copy link
Contributor

Fixes #15271

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

core (https://github.com/home-assistant/core)
+ homeassistant/core_config.py:529: error: Argument 1 of "discard" is incompatible with supertype "builtins.set"; supertype defines the argument type as "object"  [override]
+ homeassistant/core_config.py:529: note: This violates the Liskov substitution principle
+ homeassistant/core_config.py:529: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

@randolf-scholz
Copy link
Contributor Author

Homeassistent error is harmless:

class _ComponentSet(set[str]):
    def discard(self, value: str) -> None:
        """Remove a component from the store."""
        raise NotImplementedError("_ComponentSet does not support discard, use remove")

they just need to update to object.

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.

Several methods on built-in types are too strict.

1 participant