diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-06-28 00:25:01 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-06-28 00:25:01 +0100 |
commit | 29ac9ec597c195f1325cc764594d6b57b019e23a (patch) | |
tree | 4f56c694b2c16e625b599bed61f23b91ec27e613 /poezio/singleton.py | |
parent | 36377f78ba388e995687b0179ec351f8fbd54afe (diff) | |
download | poezio-29ac9ec597c195f1325cc764594d6b57b019e23a.tar.gz poezio-29ac9ec597c195f1325cc764594d6b57b019e23a.tar.bz2 poezio-29ac9ec597c195f1325cc764594d6b57b019e23a.tar.xz poezio-29ac9ec597c195f1325cc764594d6b57b019e23a.zip |
Import Singleton instead of its module, and remove unused imports.
Diffstat (limited to 'poezio/singleton.py')
-rw-r--r-- | poezio/singleton.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/poezio/singleton.py b/poezio/singleton.py index 9133012b..7f12796b 100644 --- a/poezio/singleton.py +++ b/poezio/singleton.py @@ -13,8 +13,8 @@ This method is the only one that I can come up with that do not call __init__() each time. """ -instances = {} +_instances = {} def Singleton(cls, *args, **kwargs): - if not cls in instances: - instances[cls] = cls(*args, **kwargs) - return instances[cls] + if not cls in _instances: + _instances[cls] = cls(*args, **kwargs) + return _instances[cls] |