Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca47c8f

Browse files
authored
Merge pull request taizilongxu#51 from soodooo/master
修改装饰器错误
2 parents ef9685e + b73293f commit ca47c8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ class MyClass2(Borg):
557557
### 3 装饰器版本
558558

559559
```python
560-
def singleton(cls, *args, **kw):
560+
def singleton(cls):
561561
instances = {}
562-
def getinstance():
562+
def getinstance(*args, **kw):
563563
if cls not in instances:
564564
instances[cls] = cls(*args, **kw)
565565
return instances[cls]

0 commit comments

Comments
 (0)