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
File details
Details for the file design-patterns-WS-1.0.0.tar.gz
.
File metadata
- Download URL: design-patterns-WS-1.0.0.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ffe4d492729be2d31aa11de95333dbafbbcb4017d2d7e0f74ae245839b168a8 |
|
MD5 | fe545f29b9067d15dbcc6a2009c61023 |
|
BLAKE2b-256 | 8799e01b9419415055798db37ae791a13a8885704b9fec61c46ba65a72674703 |
File details
Details for the file design_patterns_WS-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: design_patterns_WS-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c42998b8ed1d1e903a31277ecf3c46333b069503fb1f99857bee0578ff8008c |
|
MD5 | 0b8ec5e5dde399a00e2b7e6e51fe4240 |
|
BLAKE2b-256 | cd85abc629e0b6b4140c739e5d381efe3ac0e67cfc0fe2281c7f94f8241e7551 |