import mapexcept
# Basic usage
for i in mapexcept(['1', '2', '3', 'FOOBAR', '4'])[ValueError](int):
print(i)
# 1
# 2
# 3
# 4
print('
')
# With default values
for i in mapexcept(['1', '2', '3', 'FOOBAR', '4'])[ValueError:0](int):
print(i)
# 1
# 2
# 3
# 0
# 4
print('
')
# As a decorator
@mapexcept(['1', '2', '3', 'FOOBAR', '4'])[ValueError:0]
def conversion(val:str):
return int(val)
for i in conversion:
print(i)
# 1
# 2
# 3
# 0
# 4
Metadata
Release files for mapexcept 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mapexcept-1.0.0.tar.gz | 1.8 kB | Details |
Release files / mapexcept-1.0.0.tar.gz
| Download URL | mapexcept-1.0.0.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b31ff97b3e27db9f89f6708f3b64170bf9800fab24f25a7734104e243942a46c
|
|
BLAKE2b-256 checksum How to use checksums |
9110a2c4d42d8fac6d5672ca28b389125109358472dd06792f24e2a49944025f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.4
|