This project aims at usage of decorators, metaclasses and descriptors for advanced python programming. Different Use cases of design patterns are written such as:
- Decorators
- Descriptors
- Metaclasses and
- Design Patterns
Various Creational design patterns are implemented:
- Singleton
- Factory
- Abstract Factory
- Builder
Code is well documented and Unit test cases are added.
There is no dependency of any library. Just clone this project and start executing the code. Code is quite simple and easy to understand.
git clone https://github.com/imsurinder90/metaclasses_and_patterns_in_python.git
>>> python -m tests.test_class_decorator
..
----------------------------------------------------------------------
Ran 2 tests in 0.001s
OK
>>> python -m testtest discover
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
https://python-3-patterns-idioms-test.readthedocs.io/en/latest/Singleton.html
https://stackabuse.com/design-patterns-in-python/
https://stackabuse.com/python-metaclasses-and-metaprogramming/
https://github.com/faif/python-patterns
https://www.youtube.com/watch?v=sPiWg5jSoZI&t=51s