A small python module containing decorators for implementing design patterns
Project description
Introduction:
This is a small python module to design a singleton class python (will add more later on).I have been using python for 2 years and fell in love with it and I would really love to give something (even as small as this module) to the community. If you like it give it a start,hate it tell me why I will try to fix it and you could help too.
Design Patterns Supported
Singleton
Example
from design_patterns import singleton
@singleton
class HelloWorld:
def __init__(self):
self.name = "one instance"
h = HelloWorld()
r = HelloWorld()
if __name__ == "__main__":
print(r == h)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for design_patterns_WS-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c42998b8ed1d1e903a31277ecf3c46333b069503fb1f99857bee0578ff8008c |
|
MD5 | 0b8ec5e5dde399a00e2b7e6e51fe4240 |
|
BLAKE2b-256 | cd85abc629e0b6b4140c739e5d381efe3ac0e67cfc0fe2281c7f94f8241e7551 |