Skip to content
Open
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
8 changes: 4 additions & 4 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,12 @@ include extra code to make sure it works in all the supported versions.

Some examples which show how to handle those cases are described below.

Context Managers
Type annotation for unions
~~~~~~~~~~~~~~~~

Context managers aren't available in Python 2.5 by default. If you want to use
them make sure to put from ``__future__ import with_statement`` on top of the
file where you use them.
In Python 3.9 and below, the pipe character (``|``) cannot be used for union
types in type annotations. Instead, you should use ``Union`` from the ``typing``
module:

Utility functions for cross-version compatibility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down