This defines a decorator that causes the 'result' variable to be returned when there is no explicit return
Project description
return-result
This defines a decorator that causes 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.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for return_result-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f66c3d61a25fae1aed6f3e109a6af77d86eed7c78a3ffb27d09eaa20464c808 |
|
MD5 | a32802fc7d6419da196eeb4aaaf0ba67 |
|
BLAKE2b-256 | 03fa1812aff9c61e0ef3d17602434f57f301852e362488d58ae1ffafde355443 |