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

Stubtest crashes if an@overload is decorated #20064

Open
@jorenham

Description

@jorenham

Crash Report

I tried runningstubtest on the numpy codebase using the compiled mypy 1.18.2 version + the patch from#20063. This triggered an assertion failure inhypothesis.extra.numpy.arrays (huh?). The relevant code contains code like

@overload@defines_strategy(force_reusable_values=True)defarrays(# --snip--

which I believe is what is triggering this asserion to fail. SeeHypothesisWorks/hypothesis#4564 for the relevant code.

Traceback

Traceback (most recent call last):  File"/home/joren/Workspace/numpy/.venv/bin/stubtest", line10, in<module>    sys.exit(main())~~~~^^  File"/home/joren/Workspace/numpy/.venv/lib/python3.14/site-packages/mypy/stubtest.py", line2448, inmainreturn test_stubs(parse_options(sys.argv[1:]))  File"/home/joren/Workspace/numpy/.venv/lib/python3.14/site-packages/mypy/stubtest.py", line2296, intest_stubsfor errorin test_module(module):~~~~~~~~~~~^^^^^^^^  File"/home/joren/Workspace/numpy/.venv/lib/python3.14/site-packages/mypy/stubtest.py", line257, intest_moduleyield from verify(stub, runtime, [module_name])  File"/home/joren/Workspace/numpy/.venv/lib/python3.14/site-packages/mypy/stubtest.py", line436, inverify_mypyfileyield from verify(stub_entry, runtime_entry, object_path+ [entry])  File"/home/joren/Workspace/numpy/.venv/lib/python3.14/site-packages/mypy/stubtest.py", line1347, inverify_overloadedfuncdef    stub_sig= Signature.from_overloadedfuncdef(stub)  File"/home/joren/Workspace/numpy/.venv/lib/python3.14/site-packages/mypy/stubtest.py", line971, infrom_overloadedfuncdefassert funcisnotNone,f"Failed to resolve decorated overload of{stub.fullname!r}"^^^^^^^^^^^^^^^^AssertionError:Failed to resolve decorated overload of 'hypothesis.extra.numpy.arrays'

To Reproduce

  • clonehttps://github.com/numpy/numpy
  • uv venv .venv
  • source .venv/bin/activate
  • uv pip install -r requirements/build_requirements.txt -r requirements/test_requirements.txt
  • spin build
  • createmypy.ini:
    [mypy]ignore_errors = True
  • createallowlist.txt:
    numpy\._typing.*numpy\.typing\.mypy_pluginnumpy\.conftest.*numpy\.random\._generator\.__test__numpy(\.\w+)?\.tests.*numpy\._core\.cversionsnumpy\.f2py\.__main__numpy\.distutils.*numpy\.f2py\._backends\._distutilsnumpy\._build_utils.*numpy\._pyinstaller.*
  • stubtest --mypy-config-file=mypy.ini --allowlist=allowlist.txt --concise --tb numpy

Your Environment

  • Mypy version used: 1.18.2 (compiled: yes)
  • Mypy command-line flags: see above
  • Mypy configuration options frommypy.ini (and other config files): see above
  • Python version used: 3.14.0
  • Operating system and version: Ubuntu 22.04

BTW, addinghypothesis.* to the allowlist doesn't seem to help.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp