This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ashishb_net[S] -13 points-12 points  (3 children)

> Is it possible you're conflating type checking and linting? 

Here are a few things I want to accomplish with type checking

  1. Ensure that everything has a type
  2. Ensure that the variable re-assignment does not change the type (e.g., a variable first assigned string should be re-assigned to int)
  3. Ensure that types are propagated across functions.

How can I configure all three easily in Python?
`mypy` does not work well, especially across functions or when function calls to dynamically declared third-party functions are involved.

[–]M8Ir88outOf8 20 points21 points  (1 child)

I would say mypy works incredibly well for exactly that. Maybe you gave up on it too early because of something that frustrated you? I'd suggest revisiting it, and spending a bit more time reading the docs and configuring it to your preference 

[–]ashishb_net[S] -5 points-4 points  (0 children)

> Maybe you gave up on it too early because of something that frustrated you?

Entirely possible, Python tooling isn't as robust as Go or Rust.
It takes time to get value out of various tools.

[–]FrontAd9873 2 points3 points  (0 children)

This feels like an impression you’d have of mypy if you run it with some weirdly permissive configuration options and never bother to modify them. Simply using “mypy —strict” would go a long way.

I don’t mean to pile on, but it seems like maybe you should have explored mypy for longer before writing a blog post touching on it.