Skip to content

imsurinder90/metaclasses_and_patterns_in_python

Repository files navigation

Metaclasses, Decorators, Descriptors and Design Patterns in Python

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.

Installation

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

Run Unit Test cases

>>> python -m tests.test_class_decorator
..
----------------------------------------------------------------------

Ran 2 tests in 0.001s

OK

Run All Unit Test cases at once

>>> python -m testtest discover

Contributing

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.

References

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

License

MIT

About

This project aims at usage of decorators, metaclasses and descriptors for advanced python programming

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages