mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-17 01:32:37 +02:00
add docstring
This commit is contained in:
@ -48,3 +48,18 @@ Returns:
|
|||||||
|
|
||||||
no return, just prints output to STDERR
|
no return, just prints output to STDERR
|
||||||
|
|
||||||
|
## has_data
|
||||||
|
```python
|
||||||
|
has_data(data)
|
||||||
|
```
|
||||||
|
|
||||||
|
Checks if the input contains data. If there are any non-whitespace characters then return True, else return False
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
data: (string) input to check whether it contains data
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
Boolean True if input string (data) contains non-whitespace characters, otherwise False
|
||||||
|
|
||||||
|
11
jc/utils.py
11
jc/utils.py
@ -70,4 +70,15 @@ def compatibility(mod_name, compatible):
|
|||||||
|
|
||||||
|
|
||||||
def has_data(data):
|
def has_data(data):
|
||||||
|
"""
|
||||||
|
Checks if the input contains data. If there are any non-whitespace characters then return True, else return False
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
|
||||||
|
data: (string) input to check whether it contains data
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
Boolean True if input string (data) contains non-whitespace characters, otherwise False
|
||||||
|
"""
|
||||||
return True if data and not data.isspace() else False
|
return True if data and not data.isspace() else False
|
||||||
|
Reference in New Issue
Block a user