Simplify your (Python) Life
We'll go over some intermediate to advanced topics and consider pros and cons of choosing the simpler approach vs. the possibly more complicated or redundant one. The aim is to reduce the number of language APIs and constructs most programmers have to carry in their head to a smaller and more coherent set. Along the way some best practices will also be discussed that are at a higher level than things that can be flagged by automated syntax checking tools such as pylint, pyflakes, etc.
Following are the topics we'll cover:
- Language/API design and how warts can creep into even well designed products over time.
- "Worse is better" approach may be good enough ("satisficing").
- An eclectic mix of language constructs that usually trip newcomers--and sometimes even experienced programmers--which we'll survey:
- classmethod vs. staticmethod
- decorators (guidelines for writing your own)
- class decorators vs. metaclasses
- delegation via getattr
- Interfaces and getattr
- We'll see how delegation and interfaces tie into the thinking behind GoF Design Patterns.