Compare commits

...

3 commits

Author SHA1 Message Date
Miss Islington (bot)
54261b6782
[3.14] gh-138859: Account for ParamSpec defaults that are not lists … (GH-138868) (#140207)
gh-138859: Account for `ParamSpec` defaults that are not lists … (GH-138868)
(cherry picked from commit 379fd020a0)

Co-authored-by: bzoracler <50305397+bzoracler@users.noreply.github.com>
2025-10-16 13:26:29 -07:00
Tan Long
12903c098b
[3.14] Remove duplicate words in the documentation (GH-140221) (GH-140225)
(cherry picked from commit 2ebd0cdb16)
2025-10-16 20:10:15 +02:00
Miss Islington (bot)
48b60495b7
[3.14] gh-140078: fix typo in tkinter docs (GH-140081) (#140217)
gh-140078: fix typo in tkinter docs (GH-140081)

Remove extraneous word.
(cherry picked from commit 5f357f3b0d)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-10-16 15:22:57 +00:00
7 changed files with 17 additions and 6 deletions

View file

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

View file

@ -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.

View file

@ -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.

View file

@ -1140,7 +1140,7 @@ concurrent.futures
.. _whatsnew314-concurrent-futures-start-method:
* On Unix platforms other than macOS, :ref:`'forkserver'
<multiprocessing-start-method-forkserver>` is now the the default :ref:`start
<multiprocessing-start-method-forkserver>` is now the default :ref:`start
method <multiprocessing-start-methods>` for
:class:`~concurrent.futures.ProcessPoolExecutor`
(replacing :ref:`'fork' <multiprocessing-start-method-fork>`).
@ -1591,7 +1591,7 @@ multiprocessing
.. _whatsnew314-multiprocessing-start-method:
* On Unix platforms other than macOS, :ref:`'forkserver'
<multiprocessing-start-method-forkserver>` is now the the default :ref:`start
<multiprocessing-start-method-forkserver>` is now the default :ref:`start
method <multiprocessing-start-methods>`
(replacing :ref:`'fork' <multiprocessing-start-method-fork>`).
This change does not affect Windows or macOS, where :ref:`'spawn'

View file

@ -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)

View file

@ -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.

View file

@ -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.