Skip to content

Commit e0056fc

Browse files
authored
Merge branch 'main' into hypothesis-configuration
2 parents 1390208 + 2f7b5e4 commit e0056fc

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Doc/library/typing.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
This module provides runtime support for type hints. The most fundamental
2121
support consists of the types :data:`Any`, :data:`Union`, :data:`Callable`,
22-
:class:`TypeVar`, and :class:`Generic`. For a full specification, please see
22+
:class:`TypeVar`, and :class:`Generic`. For a specification, please see
2323
:pep:`484`. For a simplified introduction to type hints, see :pep:`483`.
2424

2525

@@ -592,7 +592,7 @@ The module defines the following classes, functions and decorators.
592592
when the checked program targets Python 3.9 or newer.
593593

594594
The deprecated types will be removed from the :mod:`typing` module
595-
in the first Python version released 5 years after the release of Python 3.9.0.
595+
no sooner than the first Python version released 5 years after the release of Python 3.9.0.
596596
See details in :pep:`585`—*Type Hinting Generics In Standard Collections*.
597597

598598

@@ -1291,6 +1291,8 @@ These are not used in annotations. They are building blocks for creating generic
12911291
U = TypeVar('U', bound=str|bytes) # Can be any subtype of the union str|bytes
12921292
V = TypeVar('V', bound=SupportsAbs) # Can be anything with an __abs__ method
12931293

1294+
.. _typing-constrained-typevar:
1295+
12941296
Using a *constrained* type variable, however, means that the ``TypeVar``
12951297
can only ever be solved as being exactly one of the constraints given::
12961298

@@ -1550,7 +1552,7 @@ These are not used in annotations. They are building blocks for creating generic
15501552

15511553
.. data:: AnyStr
15521554

1553-
``AnyStr`` is a :class:`constrained type variable <TypeVar>` defined as
1555+
``AnyStr`` is a :ref:`constrained type variable <typing-constrained-typevar>` defined as
15541556
``AnyStr = TypeVar('AnyStr', str, bytes)``.
15551557

15561558
It is meant to be used for functions that may accept any kind of string
@@ -2112,7 +2114,7 @@ Other concrete types
21122114
Python 2 is no longer supported, and most type checkers also no longer
21132115
support type checking Python 2 code. Removal of the alias is not
21142116
currently planned, but users are encouraged to use
2115-
:class:`str` instead of ``Text`` wherever possible.
2117+
:class:`str` instead of ``Text``.
21162118

21172119
Abstract Base Classes
21182120
---------------------

Python/assemble.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ assemble_emit_exception_table_entry(struct assembler *a, int start, int end,
128128
assert(end > start);
129129
int target = handler->h_offset;
130130
int depth = handler->h_startdepth - 1;
131-
if (handler->h_preserve_lasti) {
131+
if (handler->h_preserve_lasti > 0) {
132132
depth -= 1;
133133
}
134134
assert(depth >= 0);
@@ -146,6 +146,7 @@ assemble_exception_table(struct assembler *a, instr_sequence *instrs)
146146
int ioffset = 0;
147147
_PyCompile_ExceptHandlerInfo handler;
148148
handler.h_offset = -1;
149+
handler.h_preserve_lasti = -1;
149150
int start = -1;
150151
for (int i = 0; i < instrs->s_used; i++) {
151152
instruction *instr = &instrs->s_instrs[i];

0 commit comments

Comments
 (0)