Skip to content

Commit 3ee1b32

Browse files
Polandia94tisonkun
andauthored
change old python example (#2059)
Co-authored-by: tison <wander4096@gmail.com>
1 parent 5a03f12 commit 3ee1b32

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/development.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,12 @@ include extra code to make sure it works in all the supported versions.
444444

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

447-
Context Managers
447+
Type annotation for unions
448448
~~~~~~~~~~~~~~~~
449449

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

454454
Utility functions for cross-version compatibility
455455
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)