Skip to content

Commit

Permalink
修改装饰器错误
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyisee committed Mar 30, 2018
1 parent ef9685e commit b73293f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,9 @@ class MyClass2(Borg):
### 3 装饰器版本

```python
def singleton(cls, *args, **kw):
def singleton(cls):
instances = {}
def getinstance():
def getinstance(*args, **kw):
if cls not in instances:
instances[cls] = cls(*args, **kw)
return instances[cls]
Expand Down

0 comments on commit b73293f

Please sign in to comment.