{"repo":"faif/python-patterns","free":true,"listed":false,"github":"https://github.com/faif/python-patterns","clone":"git clone https://github.com/faif/python-patterns.git","description":"A collection of design patterns/idioms in Python","language":"Python","stars":42929,"topics":["python","idioms","design-patterns"],"license":null,"category":"dev-tools","readme_excerpt":"python-patterns A collection of design patterns and idioms in Python. Remember that each pattern has its own trade-offs. And you need to pay attention more to why you're choosing a certain pattern than to how to implement it. Creational Patterns Patterns that deal with object creation — abstracting and controlling how instances are made. Pattern Description :-------: ----------- abstract factory use a generic function with specific factories borg a singleton with shared-state among instances builder instead of using multiple constructors, builder object receives parameters and returns constructed objects factory delegate a specialized function/method to create instances lazy evaluation lazily-evaluated property pattern in Python pool preinstantiate and maintain a group of instances of the same type prototype use a factory and clones of a prototype for new instances (if instantiation is expensive) Structural Patterns Patterns that define how classes and objects are composed to form larger, flexible structures. Pattern Description :-----------------------------------------------------------: -------------------------------------------------------------------------------- 3-tier data business logic presentation separation (strict relationships) adapter adapt one interface to another using a white-list bridge a client-provider middleman to soften interface changes composite lets clients treat individual objects and compositions uniformly decorator wrap functionality with other fu","default_branch":null,"files":null,"tree":[],"storefront":"/r/faif","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/faif/python-patterns/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}