FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Respect explicit return type of __new__() by ilevkivskyi · Pull Request #21441 · python/mypy · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Update docstring
  • Loading branch information
ilevkivskyi committed May 8, 2026
commit 73bb465a2e1da8a99eef5b4a71ec82eb97069ae8
5 changes: 3 additions & 2 deletions mypy/types.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2319,8 +2319,9 @@ def is_type_obj(self) -> bool:
def get_instance_type(self, *, force_fallback: bool = False) -> ProperType:
"""Get underlying type of a type object.

By default, this will return a precise self-type, most notably a TupleType for
named tuples. If an Instance fallback is required, use force_fallback=True.
By default, this will return a precise self-type, essentially whatever is
returned by fill_typevars(). Most notably this is a TupleType for named tuples.
If an Instance fallback is required, use force_fallback=True.
"""
assert self.is_type_obj()
if self.instance_type is not None:
Expand Down
Loading

Back | FazBrowse Home | New Git URL