mirror of
https://github.com/python/cpython.git
synced 2025-10-19 07:53:46 +00:00
Compare commits
3 commits
e69fb2008e
...
54261b6782
Author | SHA1 | Date | |
---|---|---|---|
![]() |
54261b6782 | ||
![]() |
12903c098b | ||
![]() |
48b60495b7 |
7 changed files with 17 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
Loading…
Add table
Add a link
Reference in a new issue