diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index ddf503af82d..743d617fbe7 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1253,7 +1253,7 @@ find and load modules. To accommodate this requirement, when running on iOS, extension module binaries are *not* packaged as ``.so`` files on ``sys.path``, but as individual standalone frameworks. To discover those frameworks, this loader - is be registered against the ``.fwork`` file extension, with a ``.fwork`` + is registered against the ``.fwork`` file extension, with a ``.fwork`` file acting as a placeholder in the original location of the binary on ``sys.path``. The ``.fwork`` file contains the path of the actual binary in the ``Frameworks`` folder, relative to the app bundle. To allow for diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a9658820f66..f8397b861d9 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -5944,7 +5944,7 @@ It is written as ``None``. The Ellipsis Object ------------------- -This object is commonly used used to indicate that something is omitted. +This object is commonly used to indicate that something is omitted. It supports no special operations. There is exactly one ellipsis object, named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:`Ellipsis` singleton. diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index f284988daf2..be26af02bce 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -392,7 +392,7 @@ by spaces. Without getting into too many details, notice the following: * Operations which are implemented as separate *commands* in Tcl (like ``grid`` or ``destroy``) are represented as *methods* on Tkinter widget objects. As you'll see shortly, at other times Tcl uses what appear to be - method calls on widget objects, which more closely mirror what would is + method calls on widget objects, which more closely mirror what is used in Tkinter. diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index ad4330e63e0..bc4e34fa338 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -1140,7 +1140,7 @@ concurrent.futures .. _whatsnew314-concurrent-futures-start-method: * On Unix platforms other than macOS, :ref:`'forkserver' - ` is now the the default :ref:`start + ` is now the default :ref:`start method ` for :class:`~concurrent.futures.ProcessPoolExecutor` (replacing :ref:`'fork' `). @@ -1591,7 +1591,7 @@ multiprocessing .. _whatsnew314-multiprocessing-start-method: * On Unix platforms other than macOS, :ref:`'forkserver' - ` is now the the default :ref:`start + ` is now the default :ref:`start method ` (replacing :ref:`'fork' `). This change does not affect Windows or macOS, where :ref:`'spawn' diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index f84f972a294..4b8280b647f 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -762,6 +762,16 @@ class A(Generic[T, P, U]): ... self.assertEqual(A[float, [range]].__args__, (float, (range,), float)) self.assertEqual(A[float, [range], int].__args__, (float, (range,), int)) + def test_paramspec_and_typevar_specialization_2(self): + T = TypeVar("T") + P = ParamSpec('P', default=...) + U = TypeVar("U", default=float) + self.assertEqual(P.__default__, ...) + class A(Generic[T, P, U]): ... + self.assertEqual(A[float].__args__, (float, ..., float)) + self.assertEqual(A[float, [range]].__args__, (float, (range,), float)) + self.assertEqual(A[float, [range], int].__args__, (float, (range,), int)) + def test_typevartuple_none(self): U = TypeVarTuple('U') U_None = TypeVarTuple('U_None', default=None) diff --git a/Lib/typing.py b/Lib/typing.py index 72c0d7349ea..92b78defd11 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1097,7 +1097,7 @@ def _paramspec_prepare_subst(self, alias, args): params = alias.__parameters__ i = params.index(self) if i == len(args) and self.has_default(): - args = [*args, self.__default__] + args = (*args, self.__default__) if i >= len(args): raise TypeError(f"Too few arguments for {alias}") # Special case where Z[[int, str, bool]] == Z[int, str, bool] in PEP 612. diff --git a/Misc/NEWS.d/next/Library/2025-09-13-12-19-17.gh-issue-138859.PxjIoN.rst b/Misc/NEWS.d/next/Library/2025-09-13-12-19-17.gh-issue-138859.PxjIoN.rst new file mode 100644 index 00000000000..a5d4dd042fc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-09-13-12-19-17.gh-issue-138859.PxjIoN.rst @@ -0,0 +1 @@ +Fix generic type parameterization raising a :exc:`TypeError` when omitting a :class:`ParamSpec` that has a default which is not a list of types.