python / python/mypy

Consider removing `six`, `past`, and `future` support

Open
#13,567 7 comments 0 reactions 1 assignee View on GitHub

@sobolevn is already working on this.

Since Aug 31, 2022.

deferred feature topic-python2
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Since python2 is now no longer supported, I think it might be a good time to remove special casing of these libraries.

Why?

  1. None of them are required for python3+ code
  2. All their features are now (long) supported by python3+
  3. Their support is clearly a hack
  4. Code to support them is quite complex: https://github.com/python/mypy/blob/840a310f0b6c4a4bd7edfb141c8d1731ba4dd027/mypy/semanal.py#L1971-L2018
  5. There are multiple places where six. / etc special cases are used: mypy/stubgen.py, mypy/semanal.py, mypyc/irbuild/for_helpers.py

I don't see much benefit in keeping them.

Related https://github.com/python/mypy/issues/12237

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.