News for hackers. Stuff that matters.
Re:Adoption of Mypy for Python type checking: 45% already us... by davnicwil on Sunday March 21, 2021 @12:09PM (#26531434)
Is the solution here just to skip type checking the code of dependencies, and just check the types at the interface with your own code using your tool of choice? Or is it more complex than that?
Re:Adoption of Mypy for Python type checking: 45% already us... by neilparikh on Sunday March 21, 2021 @02:47PM (#26532810)
I think that mostly works, but it's still possible that different tools assign different semantics for the same syntax, which could then interact in a weird way if the library author wrote the interface annotations with Tool A's semantics in mind, while you ended up checking them against your code with Tool B.

I think the type systems are simple enough that this is probably a theoretical concern, and won't come up often in practice.

Re:Adoption of Mypy for Python type checking: 45% already us... by jraph on Sunday March 21, 2021 @01:40PM (#26532232)
I think so. When typing checking a project, its dependencies don't get type checked as well as far as I know. Type errors in dependencies are kind of not relevant for you, and many dependencies are not type-annotated anyway.
Re:Adoption of Mypy for Python type checking: 45% already us... by ali_m on Sunday March 21, 2021 @02:29PM (#26532653)
Well you probably do still want the type checker to at least look at the public interfaces of any libraries you depend on, since you want it to enforce that you're calling into them correctly.
Re:Adoption of Mypy for Python type checking: 45% already us... by jraph on Sunday March 21, 2021 @02:38PM (#26532735)
Absolutely. It should probably not report errors that are not in your code, by default anyway, but still extract information about typing relevant to you as much as it can.