Skip to content
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

Mypy crashes in 1.13.0 due to hybrid properties comparison #18120

Open
kylieatalan opened this issue Nov 7, 2024 · 2 comments
Open

Mypy crashes in 1.13.0 due to hybrid properties comparison #18120

kylieatalan opened this issue Nov 7, 2024 · 2 comments
Labels

Comments

@kylieatalan
Copy link

kylieatalan commented Nov 7, 2024

Crash Report

When running mypy on the following lines (error is on the Job.inbox_id ==Inbox.inbox_id line) :

return Job.query.outerjoin(
        Inbox,
        Job.inbox_id ==Inbox.inbox_id
    )

I get the error:

error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.13.0
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5848, in accept
  File "mypy/nodes.py", line 2141, in accept
  File "mypy/checkexpr.py", line 3621, in visit_comparison_expr
  File "mypy/checkexpr.py", line 3775, in dangerous_comparison
  File "mypy/meet.py", line 580, in is_overlapping_types
AssertionError: <class 'mypy.types.Overloaded'> vs <class 'mypy.types.Overloaded'>

In the above code, both Job.inbox_id and Inbox.inbox_id are hybrid properties, which is I think what is causing the issue
Traceback

(Insert traceback and other messages from mypy here -- use `--show-traceback`.)

To Reproduce

(Write what you did to reproduce the crash. Full source code is
appreciated. We also very much appreciate it if you try to narrow the
source down to a small stand-alone example.)

Your Environment

  • Mypy version used: 1.13.0
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used:
  • Operating system and version:
@kylieatalan kylieatalan changed the title Mypy crashes on Mypy crashes in 1.13.0 Nov 7, 2024
@kylieatalan kylieatalan changed the title Mypy crashes in 1.13.0 Mypy crashes in 1.13.0 due to hybrid properties comparison Nov 7, 2024
@hauntsaninja
Copy link
Collaborator

Could you provide a full repro?

@JukkaL
Copy link
Collaborator

JukkaL commented Nov 8, 2024

Can you reproduce this on an earlier mypy version (e.g. 1.11.x), or is this a regression?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants