python / python/mypy

(🐞) No error when property doesn't have a deleter

Open
#12,904 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic-descriptors topic-runtime-semantics
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

class A:
    @property
    def f(self) -> int: ...
a = A()
del a.f  # no mypy error; runtime AttributeError

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python snippet with mypy and confirm that deleting a property without a deleter produces no diagnostic. Then trace the checker’s handling of property deletion and add or update coverage for this case. Done means mypy reports the invalid del a.f operation consistently with the runtime AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.