Skip to content
Snippets Groups Projects
Commit d4061962 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

docs fixed

parent 3ab7a238
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ def Singleton(cls):
Usage:
>>> @Singleton
>>> class MyClass(object):
>>> class MyClass:
>>> ...
"""
......@@ -45,7 +45,7 @@ def SingletonWithRegardsTo(num_args: int):
Usage:
>>> @SingletonWithRegardsTo(num_args=1)
>>> class MyClass(object):
>>> class MyClass:
>>> def __init__(self, device_id: str):
>>> ...
"""
......@@ -62,11 +62,11 @@ def SingletonWithRegardsTo(num_args: int):
key = args[:num_args]
if key in it:
return it[args[:num_args]]
return it[key]
instance = it[key] = cls.__new_old__(cls)
instance.__init_old__(*args, **kw)
return instance
inst = it[key] = cls.__new_old__(cls)
inst.__init_old__(*args, **kw)
return inst
cls.__new__ = singleton_new
cls.__init_old__ = cls.__init__
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment