https://github.com/python/cpython/commit/29f7b69671a574bf04c3c0cf6df5d1c40620fbf0
commit: 29f7b69671a574bf04c3c0cf6df5d1c40620fbf0
branch: 3.14
author: Inada Naoki <[email protected]>
committer: methane <[email protected]>
date: 2026-10-30T12:37:03+09:00
summary:

Docs: fix generic class and comprehension examples (GH-160908)

(cherry picked from commit 83fe630f6f56da8acf0bb0c53639c6db30859461)

files:
M Doc/reference/compound_stmts.rst

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::
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to