diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-06-30 23:18:59 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-06-30 23:29:51 +0100 |
commit | b685df501a21e4c59371804385fedc4a2bc01823 (patch) | |
tree | 90608056b8fd31664dfe3cf93a2a3a7e1427a3c9 /poezio/singleton.py | |
parent | d636d57df4d447b95a014b8b5728ae928f05ebbf (diff) | |
download | poezio-b685df501a21e4c59371804385fedc4a2bc01823.tar.gz poezio-b685df501a21e4c59371804385fedc4a2bc01823.tar.bz2 poezio-b685df501a21e4c59371804385fedc4a2bc01823.tar.xz poezio-b685df501a21e4c59371804385fedc4a2bc01823.zip |
Remove every now-useless usage of the Singleton function.
Diffstat (limited to 'poezio/singleton.py')
-rw-r--r-- | poezio/singleton.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/poezio/singleton.py b/poezio/singleton.py deleted file mode 100644 index 7f12796b..00000000 --- a/poezio/singleton.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2010-2011 Florent Le Coz <louiz@louiz.org> -# -# This file is part of Poezio. -# -# Poezio is free software: you can redistribute it and/or modify -# it under the terms of the zlib license. See the COPYING file. - -""" -Defines a Singleton function that initialize an object -of the given class if it was never instantiated yet. Else, returns -the previously instantiated object. -This method is the only one that I can come up with that do not call -__init__() each time. -""" - -_instances = {} -def Singleton(cls, *args, **kwargs): - if not cls in _instances: - _instances[cls] = cls(*args, **kwargs) - return _instances[cls] |