A cool python function decorator to print comments
Project description
Verbosify
A cool function decorator to print selected comments 🎤
A Simple Example
from verbosify import verbosify, verbosify_with
@verbosify
def hello_word(uppercase=False):
# This is the hello_word function
if uppercase:
# verbose: return hello word in uppercase
return 'HELLO WORD'
else:
# verbose: return hello word in lowercase
return 'hello word'
a = hello_word(verbose=True)
#> 'return hello word in lowercase'
print(a)
#> 'hello word'
a = hello_word(uppercase=True, verbose=True)
#> 'return hello word in uppercase'
print(a)
#> 'HELLO WORD'
a = hello_word()
print(a)
#> 'hello word'
a = hello_word(uppercase=True)
print(a)
#> 'HELLO WORD'
You can also choose which comments to print:
@verbosify_with(' ')
def hello_word(uppercase=False):
# This is the hello_word function
if uppercase:
# verbose: return hello word in uppercase
return 'HELLO WORD'
else:
# verbose: return hello word in lowercase
return 'hello word'
a = hello_word(verbose=True)
#> 'This is the hello_word function'
#> 'return hello word in lowercase'
print(a)
#> 'hello word'
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
verbosify-0.0.1.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file verbosify-0.0.1.tar.gz.
File metadata
- Download URL: verbosify-0.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7951f8c120b5c4cff45cdd5caeb08a8b87c1c5c8e974acb251a65833cea41c91
|
|
| MD5 |
1a5df3ca3997574a3695069cb832d0ca
|
|
| BLAKE2b-256 |
2a23d94169614f1fa0e965533266b68e9355715c51b1bd96a6b6fbbae524f33a
|
File details
Details for the file verbosify-0.0.1-py3-none-any.whl.
File metadata
- Download URL: verbosify-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b3460ea330c3c5c11d9d10edbd2a9acb79e72cf179637819e99af55cb8be5d0
|
|
| MD5 |
1d890fa9322e0fe0d72f9ecfcf93071a
|
|
| BLAKE2b-256 |
e373821b44c8d3e3ba7a1e11382e2250d0afd065500903bf7a8c6ccb9e57e8ba
|