3 ms·
Exactly. That was their worst mistake ever
by rurban 1y ago
Exactly. That was their worst mistake ever
- setopt 1y agoI agree. I use Beartype to get runtime type checks, but it shouldn’t be necessary. Some support for type checking, whether at byte compile time or runtime, should land upstream.
- almostgotcaught 1y agoNever gonna happen - the fundamental premise of the language is duck typing.
- setopt 1y agoEither you add type hints to your function and should expect it to be type checked, or you don’t add type hints and remain free to use duck typing as you want. But not receiving as much as a warning when you violate type hints is the worst of both worlds. Duck typing isn’t completely incompatible with type checking btw. Haskells type classes are an elegant solution to that, for example.
- sevensor 1y agoPython protocols work great for duck typing as well. You can specify exactly how an object has to quack without constraining it to an avian family tree.