python·PythonbyMoreCoffee Designing Pythonic library APIshttps://benhoyt.com/writings/python-api-design/Open linkView original on sh.itjust.works7Comments2
kkronicmage lemmy.ca1Hide 1 replyObjects 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 way1
BBaldr replyprogramming.devYeah but sometimes you want something that has mutable state over time, and it’s easier to pack it into a self-contained thing.2
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.