You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello hello! There's nothing that puts P into scope / nothing that tells a type checker what P is meant to match.
If you changed def decorate(func: Plugin[ThemeConfig], /) -> Plugin[ThemeConfig]: to def decorate(func: Callable[P, ThemeConfig], /) -> Callable[P, ThemeConfig]: that would do the job and actually provide better type checking to callers. (Looks like Plugin is basically just an alias for Callable that loses track of parameter types)
It's also unclear to me why you need an inner function at all. Seems like you could just return func from decorate and not bother with wrapper. This would also be a fix.
Activity
dangotbanned commentedon Feb 5, 2025
Maybe resolvable by replacing
alt.theme.Pwith:altair/altair/utils/plugin_registry.py
Lines 24 to 25 in 7fce53d
Edit 1
Or changing
Pluginto this, playing with PEP 696 and importingalt.utils.plugin_registry.P:Edit 2
python/mypy#18278 (comment)
fix(typing): Resolve `alt.theme.register` warning