-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
ENH: Replace the module-level __getattr__
with explicit type annotations #17367
#17406
Conversation
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.
Looking good overall!
Could you also add a test to .../fail/modules.py to verify that getting a non-existent objects indeed results in an error?
The pre-existing test case in aforementioned module should serve as an example.
…sults in an error.
Implemented tests refer to the pre-existing test case which you've told me. |
AssertionError: Extra error "Module has no attribute" assert 4 in defaultdict(<function test_fail.<locals>.<lambda> at 0x00000233F488F678>, {3: 'C:\hostedtoolcache\windows\Python\3...7.9\x64\lib\site-packages\numpy\typing\tests\data\fail\modules.py:281: error: Module has no attribute "sys"'}) I cannot identify the cause. |
…ndeed results in an error." This reverts commit 0996962.
…vel indeed results in an error
Thanks @junjunjunk |
Thanks! @BvB93 |
Closes #17367 .
Replace the __getattr__ with explicit type annotations in __init__.pyi .