MoreCoffee@sh.itjust.works to Python@programming.devEnglish · 1 year agoDesigning Pythonic library APIsbenhoyt.comexternal-linkmessage-square2fedilinkarrow-up13arrow-down10
arrow-up13arrow-down1external-linkDesigning Pythonic library APIsbenhoyt.comMoreCoffee@sh.itjust.works to Python@programming.devEnglish · 1 year agomessage-square2fedilink
minus-squarekronicmage@lemmy.calinkfedilinkEnglisharrow-up1·1 year 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·1 year 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.