Don't use non-generic tuple etc. in stubs

Open
#3,309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
testing-qa

Research direction

Start by locating the test fixtures that define non-generic tuple, list, or dict classes, then read the discussion in pull request 3305 for context. Update the corresponding fixtures so these built-ins are always generic, and run the affected test suite to confirm tests still pass without mypy crashes.

Written by the indexing model from the issue text.

Description

priority-1-normal refactoring topic-tests

Many test fixtures use class tuple: pass or similar for list/dict (there may be others) even though these classes should be generic. If the corresponding Instance isn't generic, mypy may crash in some cases. We'd like to be able to assert that these are always generic without breaking tests. We should update the fixtures to make these always generic.

More discussion at https://github.com/python/mypy/pull/3305.

Dominant language
Python
Stars
20.6k
Forks
3.3k
Avg merge
1d 18h
Merged PRs (30d)
54

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.

More from python/mypy

All issues in python/mypy

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.