Skip to content

Commit 89e65c5

Browse files
authored
Merge pull request faif#205 from jefffffrey/master
fix a minor bug
2 parents 8bb19f5 + 6aaea96 commit 89e65c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

structural/flyweight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __call__(cls, *args, **kwargs):
3737
pool = getattr(cls, 'pool', {})
3838

3939
instance = pool.get(key)
40-
if not instance:
40+
if instance is None:
4141
instance = super(FlyweightMeta, cls).__call__(*args, **kwargs)
4242
pool[key] = instance
4343
return instance

0 commit comments

Comments
 (0)