We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ef9685e + b73293f commit ca47c8fCopy full SHA for ca47c8f
Readme.md
@@ -557,9 +557,9 @@ class MyClass2(Borg):
557
### 3 装饰器版本
558
559
```python
560
-def singleton(cls, *args, **kw):
+def singleton(cls):
561
instances = {}
562
- def getinstance():
+ def getinstance(*args, **kw):
563
if cls not in instances:
564
instances[cls] = cls(*args, **kw)
565
return instances[cls]
0 commit comments