Hacker GitHub

← All repos

python/mypy

View on GitHub ↗ ★ 20,715 Python

Optional static typing for Python

96 mentions on Hacker News by 81 people: 8 stories, 88 comments · first 2013-07-08 · latest 2026-03-17

Mentions per year 96 mentions · busiest year 2020 (17)
20082026
  1. …don't work well with Prototypes; mypy isn't able to detect the as supporting the Protocol (see: https://github.com/python/mypy/issues/5481 ). But having an automatically generated DTO could work too.
  2. …mypyc/mypyc: Compile type annotated Python to fast C extensions https://github.com/mypyc/mypyc src: https://github.com/python/mypy/tree/master/mypyc .. docs: https://mypyc.readthedocs.io/en/latest/ : mypyc docs > Using type annotations >…
  3. …- https://github.com/python/typing/issues/242 - "Final names and attributes" https://github.com/python/mypy/pull/5522 This is where `typing.Final` comes from. - "[Python-ideas] "Immutable Builder" Pattern and Operator" https://mail.pyt
    comment by westurner · 2025-12-11 · in A “frozen” dictionary for Python
  4. …two of the more complex type checkers make opposite decisions - MyPy uses visitors extensively - https://github.com/python/mypy/tree/master/mypy - TypeScript mostly uses switch/case functions - https://github.com/microsoft/TypeScript/blob/m…
    comment by chubot · 2025-09-07 · in Baby's first type checker
  5. …are in active development stage in the current time of August 2025 when this was written. mypy - https://github.com/python/mypy Pyright - https://github.com/microsoft/pyright Pyrefly - https://github.com/facebook/pyrefly ty -…
    comment by froh · 2025-08-20 · in An Update on Pytype
  6. It's literally stated in the PEP: https://peps.python.org/pep-0681/ Also: https://github.com/python/mypy/blob/501a07b45af8e44eda665e53... Also did you know mypy ignores typing of class decorators? You simply can't return a different type…
  7. …which accepts a list of Animals, and that function could append a Dog without causing a type error. https://github.com/python/mypy/issues/4976 is an interesting discussion on this in Python: should a TypedDict be allowed where a dict…
    comment by btown · 2025-03-29 · in You Need Subtyping
  8. …[1]. [0] https://docs.python.org/3/library/typing.html (from Python 3.5 - released Sep 2015) [1] https://github.com/python/mypy (v0.1 released Sep 2009)
    comment by meander_water · 2025-02-09 · in Go Data Structures: Interfaces (2009)
  9. …> Duplicate of #5613, still low priority, better use dataclasses, as suggested above. 1. https://github.com/python/mypy/issues/5944#issuecomment-4412...
  10. …support PEP 695 until its 1.11 release in July. [0] -- https://github.com/microsoft/pyright [1] -- https://github.com/python/mypy
    comment by wdroz · 2024-10-07 · in Python 3.13.0 Is Released
  11. …syntax, even though it's Pythonic enough to learn it in a rather short period of time, but still... https://github.com/python/mypy
  12. https://github.com/python/mypy > Python itself doesn't do that The type syntax is python. MyPy is part of Python. It's maintained by the python foundation. Mypy is not part of CPython because modularity is good, the same way that ANSI C…
  13. It's part of the Mypy project: https://github.com/python/mypy/tree/master/mypyc
  14. …cause problems. For example, the Mypy type checker refuses to acknowledge that this is possible: https://github.com/python/mypy/issues/1020
    comment by nickdrozd · 2024-04-03 · in Every Dunder Method in Python
  15. It's got type annotations and mypy has a discussion about it here as well: https://github.com/python/mypy/issues/1282
    comment by gigatexal · 2024-02-14 · in A bird's eye view of Polars
  16. ▲ 2
    Static Typing for Python
    story by chuckhend · 2024-01-27 · 0 comments
  17. …to achieve better results, but then it's not quite Python anymore. [0] https://nuitka.net/ [1] https://github.com/python/mypy/tree/master/mypyc
    comment by ptx · 2024-01-09 · in Python 3.13 Gets a JIT
  18. …type-checks but gives a TypeError at runtime. Oops. (cause discussed at length in https://github.com/python/mypy/issues/9015 but without action for 3 years) One solution is apparently to use `datetype` for type annotations (while continuing
    comment by jepler · 2023-11-19 · in datetime.utcnow() is now deprecated
  19. …bad programs. * Overall, I'm personally very optimistic about the future of types in Python! [1] https://github.com/python/mypy/issues/1773 [2] https://discuss.python.org/t/extend-type-hints-to-cover-exce...
    comment by gnulinux · 2023-10-18 · in What's New in Python 3.12
  20. …uniq) # 1)We have to grep out django-manager-missing like this until the following bug # is fixed: https://github.com/python/mypy/issues/12987. # 2) We grep out the line of `Found 95 errors in 16 files (checked 83 source # files)` that now…
    comment by aleksanb · 2023-10-18 · in Mypy 1.6
  21. You probably already know but you can add type hints and then check for consistency with https://github.com/python/mypy in python. Modern Python with things like https://learnpython.com/blog/python-match-case-statement/ + mypy + Ruff for…
  22. …where it's limits are, but particularly with the haskell comparison, it does not support GADTs ( https://github.com/python/mypy/issues/8252 ). Also, I know it doesn't support Rust's affine type system (ownership/borrows). Nah when it comes…
  23. …where it's limits are, but particularly with the haskell comparison, it does not support GADTs ( https://github.com/python/mypy/issues/8252 ). Also, I know it doesn't support Rust's affine type system (ownership/borrows). It's true that…
  24. …happened to trigger it. There are over 1.4k open bug tickets it's such a broken piece of software: https://github.com/python/mypy/issues?q=is%3Aissue+is%3Aopen... The involvement of Guido in mypy is such a tragedy.
    comment by lyu07282 · 2023-05-21 · in Writing Python like it's Rust
  25. …commit [3], possibly moved from the VSCode extension). [0] https://peps.python.org/pep-3107/ [1] https://github.com/python/mypy/commit/6f0826a9c169c4f05bb893... [2] https://peps.python.org/pep-0484/ [3]…
    comment by Kwpolska · 2023-04-16 · in The different uses of Python type hints
  26. Looks like they added support for unboxed floats yesterday (not sure about integers): https://github.com/python/mypy/commit/d05974b9b099ec755fd1c6...
  27. …missing ones should be easy. For the missing ones Any is a good choice. https://pyre-check.org and https://github.com/python/mypy are popular.
    comment by zitterbewegung · 2023-01-17 · in Ruby 3.2’s YJIT is Production-Ready
  28. The last time I actively looked into it (granted, some months ago), it was somewhat hindered by https://github.com/python/mypy/issues/9309 causing it to re-evaluate sources quite a lot during editing even with mypyd. I just had a quick…
    comment by shabble · 2023-01-03 · in Pyright: Static Type Checker for Python
  29. …like Python that don't provide any static type safety https://docs.python.org/3/library/typing.html https://github.com/python/mypy > let alone null safety https://docs.python.org/3/library/typing.html#typing.Optiona...
  30. …needed good type information, which is why I used mypy[0] as the AST parser/type checker. [0]: https://github.com/python/mypy
  31. Mypy is basically that. https://github.com/python/mypy
  32. …a real shame that the Python ecosystem doesn't have anything nearly as robust as TypeScript. [0] https://github.com/python/mypy/issues?q=is%3Aopen+is%3Aissue...
  33. …it allows you to turn it off when it's not worth it. [1]: https://github.com/microsoft/pyright [2]: https://github.com/python/mypy [3]: https://github.com/google/pytype [4]: https://github.com/facebook/pyre-check [5]:…
  34. …python3 type hints Mypyc ships with mypy and does this. Mypy itself and Black are compiled with it. https://github.com/python/mypy/tree/master/mypyc
  35. …the way you would think for dataclasses or at all for dicts/TypedDicts. See this for dataclasses: https://github.com/python/mypy/issues/5374#issuecomment-8841... .
    comment by oivey · 2022-06-26 · in Don't let dicts spoil your code (2020)
  36. …where either the user or the mypy devs are saying "use type: ignore as a workaround for now": https://github.com/python/mypy/issues?q=is%3Aopen+label%3Afa...
  37. It reminds me of this 5 year old bug in mypy: "int is not a Number?" [1]. [1]: https://github.com/python/mypy/issues/3186
  38. …are still a lot of areas we can improve quite a lot with far less effort than a full rewrite. 1: https://github.com/python/mypy/issues/2756#issuecomment-8772...
    comment by gjulianm · 2021-10-07 · in Faster Python with Guido van Rossum
  39. That's a PEP for Python 3.10, which isn't even released yet. And Mypy only supports it since May: https://github.com/python/mypy/issues/5206#issuecomment-8441...
    comment by iso8859-1 · 2021-07-22 · in TypeScript 4.4 Beta
  40. I'm well aware. Have you seen this drama about it? https://github.com/python/mypy/issues/5205#issuecomment-4102...
  41. See also mypy and pyproject.toml support ( https://github.com/python/mypy/issues/5205 ), although there's currently a PR in progress that'll hopefully put that to rest.
  42. mypy is actually compiled via mypyc, which should be a few times faster than interpreted Python https://github.com/python/mypy/tree/master/mypyc
  43. …up mypy). One example is JSON-like `dict`s, since mypy doesn't support recursive types yet[1]. [1] https://github.com/python/mypy/issues/731
    comment by l0b0 · 2021-03-19 · in I Want a New Duck (2020)
  44. ▲ 234
    Mypyc: Compile type-annotated Python to C
    story by mvolfik · 2021-02-23 · 94 comments
  45. It won't be ready for production use for a while, but https://github.com/python/mypy/tree/master/mypyc is being worked on.
    comment by viraptor · 2021-02-22 · in Go is not an easy language
  46. Yes: https://github.com/python/mypy/tree/master/mypyc
    comment by O5vYtytb · 2021-01-27 · in Python's Type Checking Renaissance
  47. …that we'll see a raise of crystal ( https://crystal-lang.org/ ) and a serious progress in mypyc ( https://github.com/python/mypy/tree/master/mypyc ) which provide a nice middle ground.
    comment by viraptor · 2021-01-13 · in Some Unlikely 2021 Predictions
  48. Mypy doesn't like function attributes, https://github.com/python/mypy/issues/2087
    comment by wocram · 2020-12-21 · in Python at Scale: Strict Modules
  49. …to always use isinstance checks. Its actually discouraged to return union types by the mypy team: https://github.com/python/mypy/issues/1693
    comment by londt8 · 2020-12-15 · in Exhaustiveness Checking with Mypy
  50. …black [1] code formatter. I think it would be interesting to see how EPython compares to mypyc. [0] https://github.com/python/mypy/tree/master/mypyc [1] https://github.com/psf/black/pull/1009
    comment by Rotareti · 2020-10-22 · in Attempts to make Python fast