• Python type system

    From Weatherby,Gerard@21:1/5 to All on Mon Feb 27 15:31:28 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 …

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to Gerard on Tue Feb 28 05:07:45 2023
    On Tue, 28 Feb 2023 at 03:29, Weatherby,Gerard <gweatherby@uchc.edu> wrote:
    Beyond Python, I’ve also found duck typing useful in real life. If it walks like a troll, quacks like a troll …

    ... regenerates limbs like a troll...

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)