Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.3k
Strip type objects when constructing TypeType#2832
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| class Any: pass | ||
| Any = 0 | ||
| class object: | ||
| def __init__(self): | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| class Any: pass | ||
| Any = 0 | ||
| class object: | ||
| def __init__(self) -> None: pass | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -736,7 +736,7 @@ MypyFile:1( | ||
| f | ||
| Args( | ||
| Var(a)) | ||
| def (a: builtins.Any) -> builtins.Any | ||
| def (a: Any) -> Any | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is new. I'm not comfortable with both the original and the new version. | ||
| Block:7( | ||
| ReturnStmt:7( | ||
| NameExpr(a [l])))) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is not right --
typshould never beNone. What's the purpose of this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is None in incremental mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I figured that out myself, but my comment was lost somehow. What about
builtins.Anyandtyping.Any? Why are we creating anInstancetype that corresponds toAny, and why is there abuiltins.Anyin addition totyping.Any? Shouldn't we useAnyType?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should, but these somehow got created in the tests. I have avoided this (
or fullname() == 'builtins'above), and added the assertions here to verify this is indeed the case. Perhaps we can remove the tests now.As Guido said above - or at least as I understand his comment - it will be better not to define Any in builtins fixture at all.