Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement callable return value #3
- Loading branch information
1 parent
0d1f1fc
commit 4294426
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
class Callable: | ||
"""An object appropriate to fake functions and methods.""" | ||
|
||
def __init__(self, *args): | ||
if args: | ||
self.return_value = args[0] | ||
else: | ||
self.return_value = None | ||
|
||
def __call__(self): | ||
"""Return predefined value.""" | ||
pass | ||
return self.return_value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters