-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improve CLI, refactor and document stubgen #6256
Merged
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
f3ec824
Add source mode and fix semanal
ilevkivskyi 478dc42
Start the big overhaul
ilevkivskyi c4d9e77
Move doc related stuff to a separate module
09726fb
Some more cleanup
e465bea
Complete the main rewriting
9b92d37
Some more refactoring (also to simplify testing)
b767e3f
Add some docs
e65d60a
Fix existing tests
4c2e0e9
Merge remote-tracking branch 'upstream/master' into unify-stubgen
b959d42
Copy semanal changes to new semanal
b41b494
Some progress with tests
f204858
Another idea for testing
8c71965
Even better testing; add first semanal test
4011d06
Fix lint and self-check
f3d935f
One more test
6fadc15
Remove irrelevamt TODOs, add few more tests
cc8e108
Merge remote-tracking branch 'upstream/master' into unify-stubgen
ilevkivskyi 3cf24da
Re-organize tests, and add few more
ilevkivskyi 000082e
Fix self-check
ilevkivskyi 3782291
Finish sentence in module doctring
ilevkivskyi 01872fd
Fix tempdirs in tests
ilevkivskyi ac2a1cf
Fix windows
ilevkivskyi 38f424f
One more Windows fix
1f41f91
A temporary change to debug Windows: DO NOT MERGE
ac7317d
Try reordering clean-up
d51d4f8
Docstring and comment fixes
b4ac2b4
Include private aliases only with flag
0549d3e
Add type argument for bare Final
bb00dad
Address CR
5544c11
Add support for abstract classes; add typeshed to paths
b6e366a
Sully's rst fixes
ded5482
Never return None from abstract methods
ccceb30
Merge remote-tracking branch 'upstream/master' into unify-stubgen
be4e8eb
The rest of the merge
84c1926
Fix lint
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -1382,3 +1382,56 @@ from typing import Any, Dict | |
|
||
funcs: Dict[Any, Any] | ||
f: Any | ||
|
||
[case testAbstractMethodNameExpr] | ||
from abc import ABCMeta, abstractmethod | ||
|
||
class A(metaclass=ABCMeta): | ||
@abstractmethod | ||
def meth(self): | ||
pass | ||
[out] | ||
from abc import ABCMeta, abstractmethod | ||
|
||
class A(metaclass=ABCMeta): | ||
@abstractmethod | ||
def meth(self) -> None: ... | ||
|
||
[case testAbstractMethodMemberExpr] | ||
import abc | ||
|
||
class A(metaclass=abc.ABCMeta): | ||
@abc.abstractmethod | ||
def meth(self): | ||
pass | ||
[out] | ||
import abc | ||
|
||
class A(metaclass=abc.ABCMeta): | ||
@abc.abstractmethod | ||
def meth(self) -> None: ... | ||
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. Again, should the return type be |
||
|
||
[case testABCMeta_semanal] | ||
from base import base | ||
from abc import abstractmethod | ||
|
||
class C(Base): | ||
@abstractmethod | ||
def other(self): | ||
pass | ||
|
||
[file base.py] | ||
from abc import abstractmethod, ABCMeta | ||
|
||
class Base(metaclass=ABCMeta): | ||
@abstractmethod | ||
def meth(self): | ||
pass | ||
[out] | ||
import abc | ||
from abc import abstractmethod | ||
from typing import Any | ||
|
||
class C(Base, metaclass=abc.ABCMeta): | ||
@abstractmethod | ||
def other(self) -> Any: ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should the return type be
Any
?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.
The return is
Any
only if we run semantic analyzer (test name should end in_semanal
), see a test below. But on the second thought it looks like it is not always necessary, in most common cases (like when we add the decorator here) it is better to returnAny
. I will fix this now.