Skip to content

A python meta class which makes a class as a singleton class

License

Notifications You must be signed in to change notification settings

intotherealworld/singleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Singleton

This is a meta class which makes a class as a singleton class

Usage

from singleton.singleton import Singleton

class Foo(metaclass=Singleton):
    ...

# foo and bar is the same instance
foo = Foo()
bar = Foo()
foo is bar # True

About

A python meta class which makes a class as a singleton class

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages