2 ms·
Badly designed type systems should not be the measuring stick. But in your example above, typed Python would instruct your editor and tools like mypy to flag a
by necovek 5y ago
Badly designed type systems should not be the measuring stick.
But in your example above, typed Python would instruct your editor and tools like mypy to flag any improper use of frobnicate. You can set up your editor to offer you a tip on what type to use as soon as you type in `frobnicate(`.
In cases where typing is not really available, I prefer to put types into APIs instead of variable names (and Python makes that great: `frobnicate(duration_as_timedelta=timeout)`).