Created
May 5, 2018 10:50
-
-
Save kimdwkimdw/50c18b5cf72c69c2d01bb4146c8a2b5c to your computer and use it in GitHub Desktop.
PoC for a bug in `PyTorch 0.4.0` related to IDE(eq. PyCharm)
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
import T_B as torch | |
torch.p2() # IDE can detect `p2` | |
torch.p1 # IDE cannot detect `p1` | |
""" | |
https://www.python.org/dev/peps/pep-0484/ | |
""" |
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
class A(object): | |
def p1(self): | |
""" | |
This is P1 | |
:return: nothing | |
""" | |
def p2(self): | |
""" | |
This is P2 | |
:return: nothing | |
""" |
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
from T_A import A | |
from T_A import * | |
__all__ = [] | |
for name in dir(A): | |
globals()[name] = getattr(A, name) | |
__all__+= [name] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment