From 59cda5b6bfe08df5b278eeeb855695e610142867 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 30 Oct 2026 12:11:45 +0900 Subject: [PATCH] [3.14] Docs: fix generic class and comprehension examples (GH-160908) (cherry picked from commit 83fe630f6f56da8acf0bb0c53639c6db30859461) Co-authored-by: Inada Naoki --- Doc/reference/compound_stmts.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index f9ed9b455e9baa4..f600ca74d9fdcd4 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -1732,9 +1732,9 @@ The following example indicates the full set of allowed type parameter declarati def overly_generic[ SimpleTypeVar, - TypeVarWithDefault = int, TypeVarWithBound: int, TypeVarWithConstraints: (str, bytes), + TypeVarWithDefault = int, *SimpleTypeVarTuple = (int, float), **SimpleParamSpec = (str, bytearray), ]( @@ -1835,7 +1835,7 @@ and decorators are evaluated outside that scope. This is illustrated by this example:: @decorator - class Bag(Base[T], arg=T): ... + class Bag[T](Base[T], arg=T): ... This is equivalent to::