Skip to content

Commit a0db8ab

Browse files
committed
Docs
1 parent 240b9e0 commit a0db8ab

File tree

6 files changed

+34
-18
lines changed

6 files changed

+34
-18
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _get_project_meta():
7676

7777
# Set `typing.TYPE_CHECKING` to `True`:
7878
# https://pypi.org/project/sphinx-autodoc-typehints/
79-
set_type_checking_flag = True
79+
set_type_checking_flag = False
8080

8181
# Add any paths that contain templates here, relative to this directory.
8282
templates_path = ['_templates']

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Contents
2525

2626
pages/maybe.rst
2727
pages/result.rst
28-
pages/context.rst
2928
pages/io.rst
29+
pages/context.rst
3030

3131
.. toctree::
3232
:maxdepth: 2

docs/pages/io.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,11 @@ Once applied, it transforms the return type to be ``IOResultE``:
317317
Use for impure operations that might fail.
318318

319319

320+
Helpers
321+
-------
322+
320323
io_squash
321-
---------
324+
~~~~~~~~~
322325

323326
This function allows to squash several ``IO`` containers together.
324327

@@ -348,7 +351,7 @@ We support up to 9 typed parameters to this function.
348351
.. _unsafe_perform_io:
349352

350353
unsafe_perform_io
351-
-----------------
354+
~~~~~~~~~~~~~~~~~
352355

353356
Sometimes you really need to get the raw value from ``IO`` container.
354357
For example:

docs/pages/maybe.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,18 @@ It looks way uglier and can grow even more uglier and complex
9191
when new logic will be introduced.
9292

9393

94-
@maybe decorator
95-
----------------
94+
Decorators
95+
----------
96+
97+
Limitations
98+
~~~~~~~~~~~
99+
100+
Typing will only work correctly
101+
if :ref:`decorator_plugin <type-safety>` is used.
102+
This happens due to `mypy issue <https://github.com/python/mypy/issues/3157>`_.
103+
104+
maybe
105+
~~~~~
96106

97107
Sometimes we have to deal with functions
98108
that dears to return ``Optional`` values!

docs/pages/result.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,18 @@ There are several useful alises for ``Result`` type with some common values:
5656
and ``ResultError`` at the same time.
5757

5858

59+
Decorators
60+
----------
61+
62+
Limitations
63+
~~~~~~~~~~~
64+
65+
Typing will only work correctly
66+
if :ref:`decorator_plugin <type-safety>` is used.
67+
This happens due to `mypy issue <https://github.com/python/mypy/issues/3157>`_.
68+
5969
safe
60-
----
70+
~~~~
6171

6272
:func:`safe <returns.functions.safe>` is used to convert
6373
regular functions that can throw exceptions to functions
@@ -79,13 +89,6 @@ Supports both async and regular functions.
7989
>>> str(divide(0))
8090
'<Failure: division by zero>'
8191
82-
Limitations
83-
~~~~~~~~~~~
84-
85-
Typing will only work correctly
86-
if :ref:`decorator_plugin <type-safety>` is used.
87-
This happens due to `mypy issue <https://github.com/python/mypy/issues/3157>`_.
88-
8992
9093
FAQ
9194
---

returns/io.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class IOResult(
206206
Explicit marker for impure function results that might fail.
207207
208208
Definition
209-
----------
209+
~~~~~~~~~~
210210
211211
We call it "marker" since once it is marked, it cannot be unmarked.
212212
@@ -238,14 +238,14 @@ class IOResult(
238238
with :meth:`~IOResult.from_failed_io`
239239
and :meth:`IOResult.from_successful_io`
240240
- You can construct ``IOResult`` from ``Result`` values
241-
with :meth:`~IOResult.__init__`
241+
with :meth:`~IOResult.from_result`
242242
243243
We also have a lot of utility methods for better function composition like:
244244
245245
- :meth:`~IOResult.bind_result` to work
246246
with functions which return ``Result``
247247
- :meth:`~IOResult.from_typecast` to work with ``IO[Result[...]]`` values
248-
- :meth:`~IOResult.lift` and `~IOResult.lift_result` to allow
248+
- :meth:`~IOResult.lift` and :meth:`~IOResult.lift_result` to allow
249249
indirect function composition
250250
with regular and ``Result`` based functions.
251251
@@ -254,7 +254,7 @@ class IOResult(
254254
255255
256256
Implementation
257-
--------------
257+
~~~~~~~~~~~~~~
258258
259259
This class contains all the methods that can be delegated to ``Result``.
260260
But, some methods have ``raise NotImplementedError`` which means

0 commit comments

Comments
 (0)