Skip to content

Commit 367a6a2

Browse files
committed
Updates mypy to 0.780
1 parent 3d47f85 commit 367a6a2

File tree

5 files changed

+41
-36
lines changed

5 files changed

+41
-36
lines changed

docs/pages/pipeline.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,10 @@ Let's say you have to read a file contents:
189189
>>> read_result = managed_read(
190190
... impure_safe(lambda filename: open(filename, 'r'))('pyproject.toml'),
191191
... )
192-
>>> assert is_successful(read_result) # file contents are inside `IOSuccess`
192+
>>> assert is_successful(read_result) # file content is inside `IOSuccess`
193193
194-
And here's how we recommend to combine ``managed`` with other pipe functions:
194+
And here's how we recommend to combine
195+
``managed`` with other pipeline functions:
195196

196197
.. code:: python
197198
@@ -201,15 +202,16 @@ And here's how we recommend to combine ``managed`` with other pipe functions:
201202
>>> from returns.result import safe
202203
>>> from returns.io import IOSuccess
203204
204-
>>> def parse_toml(file_contents: str) -> ResultE[dict]:
205-
... return safe(tomlkit.parse)(file_contents)
205+
>>> @safe
206+
... def parse_toml(file_contents: str) -> dict:
207+
... return tomlkit.parse(file_contents)
206208
207209
>>> @safe
208210
... def get_project_name(parsed: dict) -> str:
209211
... return parsed['tool']['poetry']['name']
210212
211213
>>> pipeline_result = flow(
212-
... 'pyproject.toml',
214+
... 'pyproject.toml', # filename we work with
213215
... impure_safe(lambda filename: open(filename, 'r')),
214216
... managed_read,
215217
... bind_result(parse_toml),

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ tomlkit==0.6.0
1111

1212
# Dependencies of our project:
1313
typing-extensions==3.7.4.2
14-
mypy==0.770
14+
mypy==0.780
1515
pytest==5.4.3

poetry.lock

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typing-extensions = "^3.7"
5656

5757

5858
[tool.poetry.dev-dependencies]
59-
mypy = "^0.770"
59+
mypy = "^0.780"
6060
wemake-python-styleguide = "^0.14"
6161
flake8-pytest-style = "^1.1"
6262
flake8-pyi = "^20.5"

returns/_generated/pipeline/managed.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class _managed(Immutable): # noqa: N801
6868
We also do not break a functional abstraction for the end user.
6969
It is just an implementation detail.
7070
71+
Type inference does not work so well with ``lambda`` functions.
72+
But, we do not recommend to use this function with ``lambda`` functions.
73+
7174
"""
7275

7376
__slots__ = ('_use', '_release')

0 commit comments

Comments
 (0)