-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working
Description
Describe the bug
Star importing a TypeVar definition with the same name as a type var declared using the 3.13 syntax leads to strange behavior, seemingly caused by inconsistent name lookup. The errors look like
Cannot assign to attribute "val" for class "Foo[T@Foo]*". Type "T@Foo" is not assignable to type "T@Foo"
Code or Screenshots
Create two files:
foo.py:from typing import TypeVar T = TypeVar("T")
bar.py:from .foo import * class Foo[T]: def __init__(self, val: T): self.val: T = val
VS Code extension or command-line
This is using the VSCode extension version 1.1.405
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working