From ec03864b114f0c75b9a896f34d04f0a92d72c000 Mon Sep 17 00:00:00 2001 From: Pablo Estevez Date: Mon, 10 Mar 2025 22:41:09 +0000 Subject: [PATCH] change old python example --- docs/development.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/development.rst b/docs/development.rst index a54fa94fd4..5117d38d56 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~