Fixed calling when g isn't supplied to Composition

This commit is contained in:
Cutipus 2018-05-22 18:15:23 +03:00
parent 2057d347d4
commit a60c04fed8
2 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@ -4,7 +4,9 @@ class Composition:
self.g = g
def __call__(self, *args, **kwargs):
return self.f(self.g(*args, **kwargs))
if self.g is None:
return self.f(*args, **kwargs)
return self.f(self.g(*args, **kwargs))
@property
def __name__(self):