re: Static Typing vs Testing == Apples vs Oranges VIEW POST

VIEW FULL DISCUSSION
 

I definitely agree with the overall thesis, however generic types would help further constrain your equals and less than methods. Both should take the same generic type Twhich would ideally be bounded by some Ordered or Comparable types.

 

I doubt Python type hints support generics yet.

Anyways, you are right that generics would help. In this sense, richer static typing (e.g., linear types, ownership types, dependent types) might help checking properties/constraints via testing. However, I think we have long ways to go until static typing can tackle the kind of issues tackled by testing.

 

I doubt Python type hints support generics yet.

They do: mypy.readthedocs.io/en/stable/gene...

(e.g., linear types, ownership types, dependent types)

True dat.

Good to know Python type hints supports generics :)

code of conduct - report abuse