Metadata-Version: 2.4
Name: try2
Version: 0.0.4
Summary: SOME DESCRIPTION
Project-URL: Homepage, https://github.com/zlliu246/try2
Project-URL: Issues, https://github.com/zlliu246/try2/issues
Author-email: Liu Zuo Lin <zlliu246@gmail.com>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown


# try2
Simple wrapper for try-except blocks

# Installation
```
pip install try2
```

# Installation
```
pip install try2
```

# Quickstart
```python
from try2 import try2

def reciprocal(n):
    return 1 / n

ls = [1, 2, 0, 3, 0, 4]

for number in ls:
    x = try2(reciprocal, number, "bad")
    print(number, "=>", x)

# 1 => 1.0
# 2 => 0.5
# 0 => bad
# 3 => 0.3333333333333333
# 0 => bad
# 4 => 0.25

```

# Why I wrote this
I needed a simply one-liner try-except function for many of my projects, 
and I found myself defining helper try-except functions everywhere, which got annoying quickly

# But what if I need a more complex try-except wrapper?
If your wrapper gets any more complex than this, it's probably a good idea to write your own function
