1

I'm the maintainer of pypdf. We use a CI that currently checks mypy for Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12.

I am thinking about just running mypy for one Python version.

Does mypy in a fixed version x behave the same for all Python versions (we do have pytest covering the code; meaning if we import stuff that is not available in one version pytest will fail).

6
  • 1
    I can't say for sure, but I've always just run mypy on the latest Python version available without any issues I can think of. (I'm the maintainer of babel.) Commented Oct 3, 2023 at 5:50
  • 2
    @AbdulNiyasPM That doesn't matter if you're using from __future__ import annotations. Commented Oct 3, 2023 at 5:58
  • 1
    @dROOOze Thats what I meant by mypy==x. Of course different versions of mypy behave different. I'm asking for a pinned version - but not a specific version. Commented Oct 3, 2023 at 7:46
  • 1
    I think I got a bit confused because you were talking about a mypy which runs everything from Python 3.6 to Python 3.12, but now looking over the mypy packaging files, they don't seem to specify a maximum version of Python, so I'm guessing you'll just be running the latest mypy which supports Python 3.6. Commented Oct 3, 2023 at 7:54
  • 1
    No, it won't give same outputs: e.g. enum.member will be error below 3.10, and collections.Sequence or import formatter will be error on and above 3.10. mypy is aware of python internal and stdlib changes and analyses your code accordingly. Commented Oct 5, 2023 at 18:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.