10000 Fix mishandling of typing.Self in attrs generated inits by davfsa · Pull Request #14689 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix mishandling of typing.Self in attrs generated inits #14689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fix typehint
  • Loading branch information
davfsa committed Feb 17, 2023
commit 930e0663e92422faadd6016f6ff58c4ef0efb214
2 changes: 1 addition & 1 deletion mypy/plugins/attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
self.context = context
self.init_type = init_type

def expand_type(self, typ: Type, ctx: mypy.plugin.ClassDefContext) -> Type | None:
def expand_type(self, typ: Type | None, ctx: mypy.plugin.ClassDefContext) -> Type | None:
if typ is not None and self.info.self_type is not None:
# In general, it is not safe to call `expand_type()` during semantic analyzis,
# however this plugin is called very late, so all types should be fully ready.
Expand Down
0