Skip to content

Commit ce5abc6

Browse files
committed
Docs
1 parent 37df1b2 commit ce5abc6

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
We follow Semantic Versions since the `0.1.0` release.
44

55

6+
## WIP
7+
8+
### Misc
9+
10+
- Improves `README`
11+
12+
613
## 0.8.0
714

815
### Features

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ Make your functions return something meaningful, typed, and safe!
2424
pip install returns
2525
```
2626

27-
You might also need to [configure](https://returns.readthedocs.io/en/latest/pages/container.html#type-safety)
27+
You might also want to [configure](https://returns.readthedocs.io/en/latest/pages/container.html#type-safety)
2828
`mypy` correctly and install our plugin:
2929

3030
```ini
31+
# In setup.cfg or mypy.ini:
3132
[mypy]
3233
plugins =
3334
returns.contrib.mypy.decorator_plugin
@@ -225,20 +226,20 @@ It really bloats your source code and makes it unreadable.
225226
But, having `None` in your source code is even worth.
226227
Actually, `None` is called the [worth mistake in the history of Computer Science](https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/).
227228

228-
So, what to do? Use `Maybe` container!
229-
It consists of `Some(...)` and `Nothing` types,
230-
representing existing state and `None` state respectively.
229+
So, what to do?
230+
Use [Maybe](https://returns.readthedocs.io/en/latest/pages/maybe.html) container!
231+
It consists of `Some` and `Nothing` types,
232+
representing existing state and empty (or `None`) state respectively.
231233

232234
```python
233235
from typing import Optional
234-
from returns.maybe import Maybe
236+
from returns.maybe import Maybe, maybe
235237

238+
@maybe
236239
def bad_function() -> Optional[int]:
237240
...
238241

239-
maybe_result: Maybe[float] = Maybe.new(
240-
bad_function(),
241-
).map(
242+
maybe_result: Maybe[float] = bad_function().map(
242243
lambda number: number / 2,
243244
)
244245
# => Maybe will return Some(float) only if there's a non-None value
@@ -255,3 +256,5 @@ Or read these articles:
255256

256257
- [Python exceptions considered an anti-pattern](https://sobolevn.me/2019/02/python-exceptions-considered-an-antipattern)
257258
- [Enforcing Single Responsibility Principle in Python](https://sobolevn.me/2019/03/enforcing-srp)
259+
260+
Do you have an article to submit? Feel free to open a pull request!

0 commit comments

Comments
 (0)