A blog post on choosing more specific types rather than general ones like list and dict.

you are viewing a single comment's thread
view the rest of the comments
[–] [S] 2 points 2 years ago

yeah it's an interesting case that an int can be treated as a float. I should probably update my post to mention that it's not strictly a supertype but a special exception mentioned in python's typehinting pep: https://peps.python.org/pep-0484/#the-numeric-tower

  • source
  • parent