Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ See [0Ver](https://0ver.org/).
### Documentation

- Explain how to choose between `bind` and the `bind_*` functions
- Explain variable type annotations in the container basics example

## 0.30.0

Expand Down
7 changes: 7 additions & 0 deletions docs/pages/container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ Here's how it looks:
style F1 fill:green
style F2 fill:green

The assignment below uses Python's variable annotation syntax.
In ``result: Result[int, Any]``, ``Result[int, Any]`` tells a type checker
that the successful value is an ``int`` and the error type is unrestricted.
The annotation is optional: writing ``result = ...`` lets the type checker
infer the type of the assigned value. Annotations do not change the runtime
value or perform a type conversion.

.. code:: python

>>> from typing import Any
Expand Down