E721: mistake due to isidentifier() not considering '.'
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
E721 (do not compare types, use 'isinstance()') has an exception that allows comparison for types which are not obvious. It uses isidentifier() to determine whether it is a variable. This will miss the cases where '.' is included, such as 'type(self.member1)'. So the warning will appear while it shouldn't.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the E721 implementation and its isidentifier()-based exception logic in the repository. Reproduce the case involving type(self.member1), then add regression coverage showing that this comparison should not produce a warning; done means the test passes and the existing E721 behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100