-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Added fixers to lib2to3 #10003
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
Added fixers to lib2to3 #10003
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for all the work, but given that this is a lot of new stubs and lib2to3 is deprecated (to be removed in 3.13), I'm not sure we should really be adding all this. |
This comment has been minimized.
This comment has been minimized.
Up to you! There's still a while before 3.13. Most of the changes came from stubgen and some search&replace. |
Personally, I'm fine with adding this, although we could do a superficial review for the newly added files. |
Yes, I suppose there's no harm in it. I will take a quick look and merge this. |
stdlib/lib2to3/btm_matcher.pyi
Outdated
def run(self, leaves: Iterable[Leaf]) -> defaultdict[BaseFix, list[Node | Leaf]]: ... | ||
def print_ac(self) -> None: ... | ||
|
||
def type_repr(type_num: _T) -> _T: ... |
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.
def type_repr(type_num: _T) -> _T: ... | |
def type_repr(type_num: int) -> str | int: ... |
It takes the number of a parse tree node and returns either its name or the number again if it isn't found.
stdlib/lib2to3/fixes/fix_future.pyi
Outdated
|
||
class FixFuture(fixer_base.BaseFix): | ||
BM_compatible: ClassVar[Literal[True]] | ||
PATTERN: ClassVar[LiteralString] |
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.
I don't think LiteralString makes much sense in cases like this. Let's avoid using it.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Did this a while ago and forgot to PR. Wanted to take a look at some of the oldest issues and this one didn't seem too hard.
Closes #2510 , the least recently updated issue in typeshed (as of starting this PR)!
Add all missing stubs in lib2to3. pyright-complete most of it.