Mypy 2.0 Relased

Mypy 2.0이 릴리스되어 병렬 및 점진적 타입 검사, 기본 활성화된 --local-partial-types 및 --strict-bytes 옵션, 그리고 Python 3.9 지원 중단 등 주요 기능 개선과 성능 향상을 포함한다. 특히 병렬 타입 검사 기능은 대규모 프로젝트에서 최대 5배 속도 향상을 제공하며, 새로운 네이티브 파서와 함께 작동한다. 또한, 타입 재정의 동작 변경, 메모리 누수 수정, 오류 메시지 개선 등 다양한 버그 수정과 기능 개선이 포함되었다. 이번 릴리스는 Python 타입 검사 도구로서 실무에 즉시 적용 가능한 중요한 업데이트다.

https://mypy-lang.blogspot.com/2026/05/mypy-20-relased.html

#python #mypy #statictypechecking #parallelprocessing #mypyc

Mypy 2.0 Relased

We’ve just uploaded mypy 2.0.0 to the Python Package Index ( PyPI ). Mypy is a static type checker for Python. This release includes n...

很多 Python 加速的方法

Gea-Suan Lin's BLOG

Other #PyConUS sprints this week:

* #RAPIDSai
* django-simple-deploy and py-bugger
* #PyFyre, #MyPy, and #MyPyC
* MemRay
* #Ruff or Ty from Astral
* #WheelNext
* ci-test / linting-arguments-python

Additionally there will be an "Introduction to Sprints" open space in Room 310 at 6:00 PM.

#PyConUS2025

#ty #mypy - but mypy already compiles itself to c via #mypyc so being faster isn't what I'd be expecting, it will be different and probably find different typing errors since for all the type checkers, it comes down to a matter of opinion. Do you think that will be a runtime error? That's in the future, who knows man.

@isaaclyman
That's pretty much how #Python optimizing compilers like #cython, #mypyc, #numba, and #TaichiLang work, and iiuc is the idea behind #MOJOlang.

As for leaky abstractions, I'd mitigate that by moving the lower-level algorithms into a separate module and limit the optimization pass to that module. Higher-level modules, like CLI entry points or API server route handlers, shouldn't need the extra optimization.

Here is an example of how I used #cibuildwheel with #mypyc (which in theory can compile to C anything that you can perfectly type annotate)

https://github.com/matthewdeanmartin/untruncate_json/blob/main/cibuildwheel.toml

untruncate_json/cibuildwheel.toml at main · matthewdeanmartin/untruncate_json

Python library to repair truncated json. Translated directly from the typescript original version - matthewdeanmartin/untruncate_json

GitHub

So if I take ordinary #python (no math to speak of) and

#cythonize it
#mypyc it

No obvious pattern on if it is faster or not. I don't know where the 20% to 200x rule of thumb came from (that I've seen in various conference talks)

I've been trying every x months to speed up #python with native code. This weekend with half-assed effort I got a rust + python thing going.

The magic: #maturin + #pyo3

- c, go, c++, #cython - failed because the difficult level of dealing with the build scripts. And c, c++ are just nasty.
- #mypyc - Almost worked, but failed, the annotations have to be a perfect subset of what mypyc can handle.

Mypyc and cython need something like maturin if they want get widespread adoption.

People out here sleepin' on mypyc.

http://mypyc.readthedocs.io/

#Python #mypy #mypyc

mypyc 1.5.0+dev.cab8c674ebef944498ae4e9a89cd9c77316656ec.dirty documentation

You Should Compile Your Python And Here’s Why

write Python that’s faster than C by optimizing your code, adding standard type annotations, and using Mypyc.