8000 Fix callable instance variable support by wyfo · Pull Request #10548 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix callable instance variable support #10548

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

Merged
merged 3 commits into from
Jun 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format code
  • Loading branch information
wyfo committed May 28, 2021
commit 237defa9819c4f4f49db9239861a58c37ab8eaf7
2 changes: 2 additions & 0 deletions mypy/checkmember.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ def instance_alias_type(alias: TypeAlias,
tp = type_object_type(target.type, builtin_type)
return expand_type_by_instance(tp, target)


def is_instance_var(var: Var, info: TypeInfo) -> bool:
"""Return if var is an instance variable according to PEP 526."""
return (
Expand All @@ -540,6 +541,7 @@ def is_instance_var(var: Var, info: TypeInfo) -> bool:
and not var.is_inferred
)


def analyze_var(name: str,
var: Var,
itype: Instance,
Expand Down
0