Designing Pythonic library APIs

https://benhoyt.com/writings/python-api-design/

7 points · 2 comments · view on lemmy.world

2 Comments

kronicmage@lemmy.ca · 1 pts · 3y (1 reply)

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

balder1993@programming.dev · 2 pts · 3y

Yeah but sometimes you want something that has mutable state over time, and it’s easier to pack it into a self-contained thing.