Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typing tests:test_overload_on_compiled_functions() may not work on alternative Python implementations #98713

Closed
Assignees
sobolevn
Labels
testsTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or error
@AlexWaygood

Description

@AlexWaygood

Bug report

A few weeks ago, thetyping_extensions backport library received a bug report thattest_overload_on_compiled_functions(), a recently added test, failed when run on PyPy:python/typing_extensions#83. This is due to the fact thatbuiltins.sum() andbuiltins.print() are not compiled functions on PyPy.

The same test exists in the CPython test suite (the test was ported over totyping_extensions inpython/typing_extensions#73 after being added to the CPython test suite in#96479):

deftest_overload_on_compiled_functions(self):
withpatch("typing._overload_registry",
defaultdict(lambda:defaultdict(dict))):
# The registry starts out empty:
self.assertEqual(typing._overload_registry, {})
# This should just not fail:
overload(sum)
overload(print)
# No overloads are recorded (but, it still has a side-effect):
self.assertEqual(typing.get_overloads(sum), [])
self.assertEqual(typing.get_overloads(print), [])
.

I think the test should probably be marked with the@test.support.cpython_only decorator in the CPython test suite.

(Cc.@sobolevn, who added the test.)

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp