• 0 Posts
  • 304 Comments
Joined 2 years ago
cake
Cake day: September 13th, 2023

help-circle




  • Because to a certain extent Python is duck typed. Python has no concept of interfaces, unless you count the abc module combined with manual isinstance() checks, which I’ve never seen anyone do in production. In order to be passed to some function that expects a “file-like object”, it just has to have methods named read(), seek(), and possibly isatty(). The Python philosophy, at least as I see it, is “as long as it has methods named walk() and quack(), it’s close enough to a duck for me to treat it as one”.

    Duck typing is distinct from weak type systems, though.
















    1. There are two choices in the United States 2024 election. No third party stands a ghost of a chance of winning. No, not even if the 30,000 people you can reach on Lemmy all vote for Timothy Greenparty.
    2. A Trump victory in 2024 would not only be just as bad if not worse for the citizens of Gaza than Harris would, but also pose an existential threat to a large number of vulnerable Americans (trans people, immigrants, women seeking abortions).
    3. Given the margins of victory in 2016 and 2020, Kamala might not win if leftists don’t vote for her.
    4. Snoozing fascism for four years is better than inviting it through the door now, and buys us time to build our defenses for when it comes back.

    I’d like to focus my counterargument. Which of these statements do you disagree with?