MoreCoffee@sh.itjust.works to Python@programming.devEnglish · 2 years agoDesigning Pythonic library APIsbenhoyt.comexternal-linkmessage-square2fedilinkarrow-up13arrow-down10
arrow-up13arrow-down1external-linkDesigning Pythonic library APIsbenhoyt.comMoreCoffee@sh.itjust.works to Python@programming.devEnglish · 2 years agomessage-square2fedilink
minus-squarekronicmagelinkfedilinkEnglisharrow-up1·2 years agoObjects are just the poor man’s closures. I really hate it when libraries like urllib impose a multi-class object nesting paradigm when a simple multi argument function would be better in every way
minus-squareBaldur Nil@programming.devlinkfedilinkEnglisharrow-up2·2 years agoYeah but sometimes you want something that has mutable state over time, and it’s easier to pack it into a self-contained thing.
Objects are just the poor man’s closures. I really hate it when libraries like urllib impose a multi-class object nesting paradigm when a simple multi argument function would be better in every way
Yeah but sometimes you want something that has mutable state over time, and it’s easier to pack it into a self-contained thing.