Last active
October 20, 2019 01:30
-
-
Save phydev/c9c41f5c98e7994472827be62bc4dbe0 to your computer and use it in GitHub Desktop.
creates a decorator that allows calling functions parameterless without empty brackets.
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
""" | |
creates a decorator that allows to call functions parameterless without empty brackets. | |
@author: phydev.github.io | |
date: Sunday, 20 october 2019 02:20 | |
""" | |
def without_brackets(function): | |
""" | |
function that will be used as decorator for calling functions without using brackets | |
:param function: any function without arguments | |
:return function(): call the function | |
""" | |
return function() | |
@without_brackets | |
def test(): | |
""" | |
empty test function | |
""" | |
return 'None' | |
if __name__ == '__main__': | |
print(test) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment