There's a lot here that is pretty general and not Python specific, let's add some of those.<p>* Don't use map/filter/select unless you have no other choice. Prefer comprehensions.<p>* If a loop can be expressed by a comprehension then it should be.<p>* If you can get away with a context manager, prefer that over destructors.<p>* Put your unit tests in classes rather than module_level functions.<p>* Have def main if __name__ == __main__: main() over entrypoints that have logic at the module level.<p>* Inheritance and multiple inheritance in Python is <i>fantastic</i>. Prefer it over composition.<p>* Remove the word lambda from your vocabulary.<p>* If possible avoid returning a list and instead prefer a generator.<p>* Replace "for key in dict" with "for key, value in dict.items()" as your default way of iterating over a dict.<p>* Whenever possible use pathlib over open and always specify the encoding for files opened in text mode.<p>* It's more common to have "def abstractfunc: pass" than raise NotImplementedError.<p>* One file one class is for Java people, in Python pack it all in one file.<p>* obj.register(func) should probably be a decorator "@obj.register def func: …"<p>* Take advantage of truthy/falsely values such as [] being false. Not if len(list) > 0 but if list.<p>* Write a good __repr__ for every class.<p>* Take advantage of keyword only arguments to enforce subject.verb(object, adj1=2, adj2=2).<p>* If you leave black at the default of 80 characters someone will egg your GH profile.<p>* Add logging using the logging module and let the user if your lib decide if they're useful or not.<p>* Abuse implicit string literal concatenation over str + str + str<p>* Formatting strings with % or .format is out. Either f-strings or the string.template library.<p>* Use StringIO over string concatenation.<p>* Raise an exception over returning Union[Ok, Err] or Optional[T].<p>* Log a warning over using the warnings module.<p>* Allow reading API keys from
environment variables.<p>* from package import Thing is preferred unless the module in question is just a collection of functions.<p>* Use StrEnum over stringly typed function args.<p>* Do pass around bound methods even though it might feel wrong.