3 ms·
I use typing at interface boundaries within code and sometimes between functions. Within a function I use duck typing. As others have mentioned, I use this mor
by evgen 10y ago
I use typing at interface boundaries within code and sometimes between functions. Within a function I use duck typing. As others have mentioned, I use this more as an editor hint to warn me of questionable behavior and almost never run mypy. Yes, it only catches trivial errors, but a trivial error highlighted in the editor is easy to see/fix. The extra typing in the function sig is saved in not having to enter the same info in the docstring, so it feels like a wash to me.