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

Mypyc: Crash when using property deleter #17928

Open
aatle opened this issue Oct 13, 2024 · 0 comments
Open

Mypyc: Crash when using property deleter #17928

aatle opened this issue Oct 13, 2024 · 0 comments
Labels
crash topic-descriptors Properties, class vs. instance attributes topic-mypyc mypyc bugs

Comments

@aatle
Copy link

aatle commented Oct 13, 2024

Crash Report

Mypyc fails to compile a class that has a property with a deleter, crashing with an internal error instead of giving proper mypy error messages. (Mypy check passes.)

Traceback

$ mypyc compile.py
Traceback (most recent call last):
compile.py:2: KeyError: <mypy.nodes.FuncDef object at 0x0000021161F65B40>

To Reproduce

In a file, create a class, and create a property with getter and deleter, and optionally a setter.

class C:
    @property
    def x(self) -> int:
        return 0

    @x.deleter
    def x(self) -> None:
        pass

Run mypyc filename.py

Your Environment

  • Mypy version used: 1.11.2 (compiled)
  • Mypyc command-line flags: None
  • Mypyc configuration options from mypy.ini (and other config files): None
  • Python version used: 3.12.4
  • Operating system and version: Windows 11

Related: #13231 (open)

@aatle aatle added the crash label Oct 13, 2024
@AlexWaygood AlexWaygood added topic-descriptors Properties, class vs. instance attributes topic-mypyc mypyc bugs labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash topic-descriptors Properties, class vs. instance attributes topic-mypyc mypyc bugs
Projects
None yet
Development

No branches or pull requests

2 participants