Python type system
Weatherby,Gerard
gweatherby at uchc.edu
Mon Feb 27 10:31:28 EST 2023
When I first started transitioning to Python as a Perl replacement, with my Java/C++ baggage, I thought Pythnon had some loosey-goosey type system. I thought int() and str() were casts, not constructors. I now realize Python has a great strong type system. Duck typing. If it walks like a duck, quacks like a duck, it’s probably a duck. (C++ added the auto keyword at some point to get analogous behavior).
Beyond Python, I’ve also found duck typing useful in real life. If it walks like a troll, quacks like a troll …
More information about the Python-list
mailing list