🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@NMertsch
Copy link
Contributor

PR summary

Add missing type annotation for LocationEvent.modifiers.

Current code:

backend_bases.py

class LocationEvent(Event):
    """
    ...
    Attributes
    ----------
    ...
    modifiers : frozenset
        The keyboard modifiers currently being pressed (except for KeyEvent).
    """
    ...
    def __init__(self, ..., *, modifiers=None):
        ...
        self.modifiers = frozenset(modifiers if modifiers is not None else [])
        ...

backend_bases.pyi

class LocationEvent(Event):
    ...  # some attributes, but not `modifiers`
    def __init__(self, ..., *, modifiers: Iterable[str] | None = ...) -> None: ...

closes #30840

PR checklist

@NMertsch
Copy link
Contributor Author

I assume the failing test is unrelated to this PR.

@timhoffm timhoffm added this to the v3.11.0 milestone Dec 12, 2025
@timhoffm timhoffm merged commit 4edc215 into matplotlib:main Dec 12, 2025
41 of 42 checks passed
gigoiy pushed a commit to gigoiy/matplotlib-dev that referenced this pull request Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNT]: LocationEvent.modifiers missing in type stub

3 participants