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. black (the python auto formatter) uses mypyc https://github.com/python/mypy/tree/master/mypyc
    comment by Recursing · 2020-10-12 · in I Tried to Reduce Pylint Memory Usage
  2. …by using Cython to selectively optimize code There is also mypyc [0] coming up on the horizon. https://github.com/python/mypy/tree/master/mypyc
  3. …is not an easy read. [1]: https://coconut.readthedocs.io/en/master/FAQ.html#does-cocon... [2]: https://github.com/python/mypy/blob/master/mypy/typeanal.py
  4. Have you look at mypyc? https://github.com/python/mypy Its a compiler that support subset of python and mypy's team including Guido work on it. It would be great if this kind of efforts have been done on more realistic project.
  5. And at mypyc https://github.com/python/mypy/tree/master/mypyc
  6. you don't have to https://github.com/python/mypy/pull/5677
  7. …with [1], and then contribute it to [2]. Automatic stub generation may also be helpful [3] [1] https://github.com/python/mypy/wiki/Creating-Stubs-For-Pytho... [2] https://github.com/python/typeshed [3]…
    comment by ghostwriter · 2020-06-19 · in Practical Python Programming
  8. …checks at the very least. They do work on enums and discriminated unions. They should document it: https://github.com/python/mypy/issues/6366 https://github.com/python/mypy/issues/5818
    comment by silviogutierrez · 2020-06-06 · in Using Enumerated Types in Python
  9. eventually there may be... https://github.com/python/mypy/tree/master/mypyc
    comment by anentropic · 2020-02-12 · in Applying Mypy to real-world projects
  10. …found 4 errors that I didn't notice before. The first result in Google for this error points here https://github.com/python/mypy/issues/3905 which explains the issue. I'm ashamed to say I probably just read the first reply, added it to my…
    comment by jesseryoung · 2020-02-11 · in Applying Mypy to real-world projects
  11. You should check out mypyc https://github.com/python/mypy/tree/master/mypyc and this new recent issue that mentions targeting LLVM or other targets https://github.com/python/mypy/issues/8373 https://github.com/mypyc/mypyc/issues/709
  12. …of python that is jitted or compiled at some point in the next few years. Edit: Oh also mypyc https://github.com/python/mypy/tree/master/mypyc
    comment by m_ke · 2019-12-28 · in Python Type Hints
  13. …a work in progress though[1] and people in the ticket provided some workarounds[2][3] for now. [1] https://github.com/python/mypy/issues/731 [2] https://github.com/python/mypy/issues/731#issuecomment-53990... [3]…
    comment by takeda · 2019-12-27 · in I love coding in C
  14. …in the future. might be possible to emulate some use cases with Literal Types. tracking issue: https://github.com/python/mypy/issues/5206
  15. I was surprised to find out that MyPy will throw an error if you use a variable to access a key ( https://github.com/python/mypy/issues/7178 ). Optional keys are also a nuisance.
  16. …via mypy [3], which from my experience works similar well as TypeScript works for JavaScript. [3]: https://github.com/python/mypy
    comment by Rotareti · 2019-11-29 · in My 2019 programming language hierarchy
  17. https://github.com/python/mypy/tree/master/mypyc This may interest you. This is probably going to be the 'official' way to get what you're talking about.
    comment by staticassertion · 2019-10-20 · in Python at Scale: Strict Modules
  18. There is https://github.com/python/mypy/tree/master/mypyc that I think is a great idea and approach
    comment by bratao · 2019-10-20 · in Python at Scale: Strict Modules
  19. …like an option to "compile" python to check for typing inconsistencies You can use mypy for that: https://github.com/python/mypy
    comment by Rotareti · 2019-10-15 · in What’s New in Python 3.8
  20. …mypy [0] (statically typing with editor support for VSCode) - pylint [5] or flake8 [6] (linter) [0] https://github.com/python/mypy [1] https://docs.python.org/3/library/dataclasses.html#module-da... [2]…
    comment by Rotareti · 2019-09-19 · in Python Is Eating the World
  21. …typing - there are sometimes false positives and false negatives - but I find it helpful. [1] https://github.com/python/mypy [2] https://github.com/facebook/pyre-check [3] https://github.com/microsoft/pyright [4]…
  22. …front, if not for type safety alone. Luckily, you don't have to choose between those two outcomes: https://github.com/python/mypy
    comment by timothycrosley · 2019-09-03 · in Go 1.13 Release Notes
  23. …in Python: you can't properly annotate a function to accept anything iterable except string. https://github.com/python/mypy/issues/4334 is a FR to at least check it with mypy.
    comment by yegle · 2019-08-12 · in Python Is Eating the World
  24. …= Union[str, List['Foo']]`. [0] https://github.com/python/cpython/blob/3.8/Lib/typing.py#L15... [1] https://github.com/python/mypy/issues/731 [2] https://github.com/python/mypy/issues/6204
  25. …more recognition. The same guys working on mypyc [1], which I think is very interesting too. [0]: https://github.com/python/mypy/graphs/contributors [1]: https://github.com/mypyc/mypyc
  26. Don't forget the one from Dropbox: * https://github.com/python/mypy
    comment by Rotareti · 2019-03-24 · in Pyright: Static type checker for Python
  27. …far the most important feature of Python3. It's a godsend for larger/complicated code bases. [1]: https://github.com/python/mypy
    comment by Rotareti · 2018-12-22 · in Python 3: Ten years later
  28. And also that the second highest contributor is Guido van Rossum ( https://github.com/python/mypy/graphs/contributors ).
    comment by milliams · 2018-03-19 · in Exercises in Programming Style
  29. …type system with features such as type inference, gradual typing, generics and union types. https://github.com/python/mypy/blob/272d0c4c50918a36b57e7c0c... The section on gradual typing in PEP 483 seems consistent with this as well.…
    comment by tedmiston · 2017-10-29 · in The Ergonomics of Type Checking (2016)
  30. …for some reason it's mentioned as PEP 512 but links to the same page you mentioned. [1] https://github.com/python/mypy/pull/2761
  31. …it's nice to see such a civilised, courteous dialog between the submitter and maintainers ( https://github.com/python/mypy/pull/2761 ). I can imagine (and have previously seen) many similar dialogs break down and resort to less errm...…
  32. …creator of Python is working at Dropbox and currently on a project to add static typing to it… ( https://github.com/python/mypy/commits/master because I know the pain of linkless comments)
    comment by minitech · 2017-06-30 · in Why We Chose Typescript
  33. …SQL ORM. There's a pull request for mypy protocols which moves further toward structural subtyping: https://github.com/python/mypy/pull/3132
  34. …work on that is discussed here. I would love a dropbox google colab (though also targeting 3.x :) ) https://github.com/python/mypy/issues/1862
    comment by statsmatscats · 2017-01-04 · in Grumpy: Go running Python
  35. …(to check for __add__ and __radd__) may not take a whole lot of work, see `SupportsInt`: https://github.com/python/mypy/blob/d7f6ea617317103534d86686... http://mypy.readthedocs.io/en/latest/class_basics.html?highl...
    comment by prawks · 2016-10-14 · in Static types in Python
  36. For python what does this do? https://github.com/python/mypy/blob/master/mypy/stubgen.py
  37. …system. What are you talking about? MyPy has supported generics since before the 0.1 release: https://github.com/python/mypy/blob/v0.1.0/docs/source/gener...
    comment by masklinn · 2016-05-06 · in Typed Python: new Mypy release
  38. https://github.com/JukkaL/mypy is the/one implementation of a static checker that conforms to PEP 484. (Naturally, as far as I know, JukkaL with mypy almost singlehandedly inspired the PEP.)
    comment by pas · 2015-05-23 · in PEP 0484 – Type Hints is accepted