|
|
|
|
|
by wenc
2692 days ago
|
|
I think the author of this document is trying to differentiate between types (broad notions of course -- there's no type called 'num' in Python). The Python docs (example here[1]) on the other hand limit themselves to {}, [] and () to differentiate between dicts, lists and tuples, but doesn't really differentiate between these and the more generalized notions of collections/iterators/element, etc. As someone who codes in statically typed languages and has an intuitive sense of upcasting
/ downcasting / contravariance / covariance, this level of precision makes sense to me and enhances my appreciation for Python types. That said, I've also been writing Python professionally since 2005 so I'm comfortable with not worrying too much about types in Python -- with dynamic typing things just work as long as they have the right shape and behavior. [1] https://docs.python.org/3/library/threading.html#threading.T... |
|