_overload_dummy raises NotImplementedError, not RuntimeError#98351
Conversation
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks for catching this!
I feel like RuntimeError is a better exception to throw than NotImplementedError here, but we've apparently always used NotImplementedError and it's not worth changing.
Sorry, something went wrong.
|
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
|
Sorry, @sobolevn and @JelleZijlstra, I could not cleanly backport this to |
Sorry, something went wrong.
…ntimeError` (pythonGH-98351) (cherry picked from commit 1ca6647) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
These tests don't exist in 3.10. |
Sorry, something went wrong.
* main: (40 commits) pythongh-98461: Fix source location in comprehensions bytecode (pythonGH-98464) pythongh-98421: Clean Up PyObject_Print (pythonGH-98422) pythongh-98360: multiprocessing now spawns children on Windows with correct argv[0] in virtual environments (pythonGH-98462) CODEOWNERS: Become a typing code owner (python#98480) [doc] Improve logging cookbook example. (pythonGH-98481) Add more tkinter.Canvas tests (pythonGH-98475) pythongh-95023: Added os.setns and os.unshare functions (python#95046) pythonGH-98363: Presize the list for batched() (pythonGH-98419) pythongh-98374: Suppress ImportError for invalid query for help() command. (pythongh-98450) typing tests: `_overload_dummy` raises `NotImplementedError`, not `RuntimeError` (python#98351) pythongh-98354: Add unicode check for 'name' attribute in _imp_create_builtin (pythonGH-98412) pythongh-98257: Make _PyEval_SetTrace() reentrant (python#98258) pythongh-98414: py.exe launcher does not use defaults for -V:company/ option (pythonGH-98460) pythongh-98417: Store int_max_str_digits on the Interpreter State (pythonGH-98418) Doc: Remove title text from internal links (python#98409) [doc] Refresh the venv introduction documentation, and correct the statement about VIRTUAL_ENV (pythonGH-98350) Docs: Bump sphinx-lint and fix unbalanced inline literal markup (python#98441) pythongh-92886: Replace assertion statements in `handlers.BaseHandler` to support running with optimizations (`-O`) (pythonGH-93231) pythongh-92886: Fix tests that fail when running with optimizations (`-O`) in `_test_multiprocessing.py` (pythonGH-93233) pythongh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_py_compile.py` (pythonGH-93235) ...
Source:
cpython/Lib/typing.py
Lines 2536 to 2542 in eae7dad
I've found this while looking for implicit abstract classes / methods in CPython.
Test was checking for
RuntimeError, it is technically correct:But, we can be more precise. It is a good thing.
I am going to skip creating an issue for this, it is like a typo-fix :)