Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

design-patterns-WS-1.0.0.tar.gz (1.7 kB view hashes)

Uploaded Source

Built Distribution

design_patterns_WS-1.0.0-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page