This defines a decorator that causes the 'result' variable to be returned when there is no explicit return
Project description
return-result
This python module defines a decorator that caused the variable result
to be automatically returned from a function when there is no return statement.
Inspired by the Nim feature that does the same thing.
Example
>>> from return_result import return_result
>>> @return_result
... def test():
... result = "Works!"
>>> test()
'Works!'
Requirements
Python 3.6+
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
return-result-1.0.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for return_result-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 213355d91ddb080b433358365e07ecf36d224bf82e433a87bbe9f4a550f57fd1 |
|
MD5 | 6e0ef35aa3c77d5c536a59a86bafad06 |
|
BLAKE2b-256 | 50ed8cbfdcff00d494c4c62b6037b7a005b8f2270bd85693f43842078b4996f7 |