Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions peps/pep-0426.rst
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ declare:
dependencies, without needing to be listed three times

These optional categories are known as
`Extras <Extras (optional dependencies)_>`_. In addition to the four
:ref:`Extras <pep426-extras-optional-dependencies>`. In addition to the four

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to leave the previous link syntax if possible.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by leaving the previous syntax? If I revert these changes with git checkout main peps/pep-0426.rst, make html fails with:

pep-0426.rst:748: (ERROR/3) Duplicate target name, cannot be used as a unique reference: "extras".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the reference syntax without using the :ref: role. IIUC RST correctly, we can keep the previous syntax (no :ref:) and just update the anchor names

standard categories, projects may also declare their own custom categories
in the `Extras`_ field.

Expand Down Expand Up @@ -791,7 +791,7 @@ should be installed for the specified activities:
* the ``doc`` extra
* the ``dev`` extra

The notation described in `Extras (optional dependencies)`_ SHOULD be used
The notation described in :ref:`pep426-extras-optional-dependencies` SHOULD be used
to determine exactly what gets installed for various operations.

Installation tools SHOULD report an error if dependencies cannot be
Expand All @@ -807,7 +807,7 @@ Extras

A list of optional sets of dependencies that may be used to define
conditional dependencies in dependency fields. See
`Extras (optional dependencies)`_ for details.
:ref:`pep426-extras-optional-dependencies` for details.

The names of extras MUST abide by the same restrictions as those for
distribution names.
Expand Down Expand Up @@ -860,7 +860,7 @@ subfields:

* ``requires``: a list of requirements needed to satisfy the dependency
* ``extra``: the name of a set of optional dependencies that are requested
and installed together. See `Extras (optional dependencies)`_ for details
and installed together. See :ref:`pep426-extras-optional-dependencies` for details
* ``environment``: an environment marker defining the environment that
needs these dependencies. The syntax and capabilities of environment
markers are defined in :pep:`508`
Expand Down Expand Up @@ -985,6 +985,7 @@ If an installation tool encounters a required extension it doesn't
understand when attempting to install from a wheel archive, it MAY fall
back on attempting to install from source rather than failing entirely.

.. _pep426-extras-optional-dependencies:

Extras (optional dependencies)
==============================
Expand Down
12 changes: 8 additions & 4 deletions peps/pep-0554.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CPython has supported multiple interpreters in the same process (AKA
available via the C-API. [c-api]_ Multiple interpreters operate in
`relative isolation from one another <Interpreter Isolation_>`_, which
facilitates novel alternative approaches to
`concurrency <Concurrency_>`_.
:ref:`concurrency <pep554-concurrency>`.

This proposal introduces the stdlib ``interpreters`` module. It exposes
the basic functionality of multiple interpreters already provided by the
Expand Down Expand Up @@ -561,7 +561,7 @@ PEP proposes and likely deserves significant time on PyPI to mature.
However, this PEP does not propose any new concurrency API.
At most it exposes minimal tools (e.g. subinterpreters, channels)
which may be used to write code that follows patterns associated with
(relatively) new-to-Python `concurrency models <Concurrency_>`_.
(relatively) new-to-Python :ref:`concurrency models <pep554-concurrency>`.
Those tools could also be used as the basis for APIs for such
concurrency models. Again, this PEP does not propose any such API.

Expand Down Expand Up @@ -593,6 +593,8 @@ on copying.
About Subinterpreters
=====================

.. _pep554-concurrency:

Concurrency
-----------

Expand Down Expand Up @@ -866,7 +868,7 @@ The module also provides the following class::

In addition to the functionality of ``Interpreter.set_main_attrs()``,
the module provides a related way to pass data between interpreters:
channels. See `Channels`_ below.
channels. See :ref:`pep554-channels` below.

Uncaught Exceptions
-------------------
Expand Down Expand Up @@ -952,7 +954,7 @@ initially, including:
We will also support a small number of complex types initially:

* ``memoryview``, to allow sharing :pep:`3118` buffers
* `channels <Channels_>`_
* :ref:`channels <pep554-channels>`

Further builtin types may be supported later, complex or not.
Limiting the initial shareable types is a practical matter, reducing
Expand Down Expand Up @@ -987,6 +989,8 @@ Several of the earlier examples demonstrate this, such as
.. _interpreters-RecvChannel:
.. _interpreters-SendChannel:

.. _pep554-channels:

Channels
--------

Expand Down
189 changes: 94 additions & 95 deletions peps/pep-0653.rst
Original file line number Diff line number Diff line change
Expand Up @@ -720,149 +720,148 @@ Code examples

.. [1]

::
::

class Symbol:
__match_class__ = MATCH_SELF
class Symbol:
__match_class__ = MATCH_SELF

.. [2]

This::
This::

case [a, b] if a is b:
case [a, b] if a is b:

translates to::
translates to::

$kind = type($value).__match_container__
if $kind != MATCH_SEQUENCE:
FAIL
if len($value) != 2:
FAIL
a, b = $value
if not a is b:
FAIL
$kind = type($value).__match_container__
if $kind != MATCH_SEQUENCE:
FAIL
if len($value) != 2:
FAIL
a, b = $value
if not a is b:
FAIL

.. [3]

This::
This::

case [a, *b, c]:
case [a, *b, c]:

translates to::
translates to::

$kind = type($value).__match_container__
if $kind != MATCH_SEQUENCE:
FAIL
if len($value) < 2:
FAIL
a, *b, c = $value
$kind = type($value).__match_container__
if $kind != MATCH_SEQUENCE:
FAIL
if len($value) < 2:
FAIL
a, *b, c = $value

.. [4]

This::
This::

case {"x": x, "y": y} if x > 2:
case {"x": x, "y": y} if x > 2:

translates to::
translates to::

$kind = type($value).__match_container__
if $kind != MATCH_MAPPING:
FAIL
$tmp = $value.get("x", $sentinel)
if $tmp is $sentinel:
FAIL
x = $tmp
$tmp = $value.get("y", $sentinel)
if $tmp is $sentinel:
FAIL
y = $tmp
if not x > 2:
FAIL
$kind = type($value).__match_container__
if $kind != MATCH_MAPPING:
FAIL
$tmp = $value.get("x", $sentinel)
if $tmp is $sentinel:
FAIL
x = $tmp
$tmp = $value.get("y", $sentinel)
if $tmp is $sentinel:
FAIL
y = $tmp
if not x > 2:
FAIL

.. [5]

This::
This::

case {"x": x, "y": y, **z}:
case {"x": x, "y": y, **z}:

translates to::
translates to::

$kind = type($value).__match_container__
if $kind != MATCH_MAPPING:
FAIL
$tmp = dict($value)
if not $tmp.keys() >= {"x", "y"}:
FAIL
x = $tmp.pop("x")
y = $tmp.pop("y")
z = $tmp
$kind = type($value).__match_container__
if $kind != MATCH_MAPPING:
FAIL
$tmp = dict($value)
if not $tmp.keys() >= {"x", "y"}:
FAIL
x = $tmp.pop("x")
y = $tmp.pop("y")
z = $tmp

.. [6]

This::
This::

match ClsName(x, y):
match ClsName(x, y):

translates to::
translates to::

if not isinstance($value, ClsName):
FAIL
$attrs = ClsName.__match_args__
if len($attr) < 2:
FAIL
try:
x = getattr($value, $attrs[0])
y = getattr($value, $attrs[1])
except AttributeError:
FAIL
if not isinstance($value, ClsName):
FAIL
$attrs = ClsName.__match_args__
if len($attr) < 2:
FAIL
try:
x = getattr($value, $attrs[0])
y = getattr($value, $attrs[1])
except AttributeError:
FAIL

.. [7]

This::
This::

match ClsName(a=x, b=y):
match ClsName(a=x, b=y):

translates to::
translates to::

if not isinstance($value, ClsName):
FAIL
try:
x = $value.a
y = $value.b
except AttributeError:
FAIL
if not isinstance($value, ClsName):
FAIL
try:
x = $value.a
y = $value.b
except AttributeError:
FAIL

.. [8]

This::
This::

match ClsName(x, a=y):
match ClsName(x, a=y):

translates to::
translates to::


if not isinstance($value, ClsName):
FAIL
$attrs = ClsName.__match_args__
if len($attr) < 1:
raise TypeError(...)
$positional_names = $attrs[:1]
try:
x = getattr($value, $attrs[0])
if "a" in $positional_names:
if not isinstance($value, ClsName):
FAIL
$attrs = ClsName.__match_args__
if len($attr) < 1:
raise TypeError(...)
y = $value.a
except AttributeError:
FAIL
$positional_names = $attrs[:1]
try:
x = getattr($value, $attrs[0])
if "a" in $positional_names:
raise TypeError(...)
y = $value.a
except AttributeError:
FAIL

.. [9]

::
::

class Basic:
__match_class__ = MATCH_POSITIONAL
def __deconstruct__(self):
return self._args
class Basic:
__match_class__ = MATCH_POSITIONAL
def __deconstruct__(self):
return self._args


Copyright
Expand Down
4 changes: 3 additions & 1 deletion peps/pep-0683.rst
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ indicator that the object can be safely modified.) All other values
are considered "not 0 or 1".

This information will be clarified
in the `documentation <Documentation_>`_.
in the :ref:`documentation <pep683-documentation>`.

Arguably, the existing refcount-related API should be modified to reflect
what we want users to expect. Something like the following:
Expand Down Expand Up @@ -763,6 +763,8 @@ later if necessary.
TODO: Add a note indicating that the implemented solution does not
affect the overall ~performance-neutral~ outcome.

.. _pep683-documentation:

Documentation
-------------

Expand Down
3 changes: 2 additions & 1 deletion peps/pep-0697.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ big-picture decision tree.
.. note::

The individual cases are easier to explain in isolation (see the
`reference implementation <Reference Implementation_>`_ for draft docs).
:ref:`reference implementation <pep697-reference-implementation>` for draft docs).

* ``spec->basicsize > 0``: No change to the status quo. (The base
class layout is known.)
Expand Down Expand Up @@ -487,6 +487,7 @@ The initial implementation will include reference documentation
and a What's New entry, which should be enough for the target audience
-- authors of C extension libraries.

.. _pep697-reference-implementation:

Reference Implementation
========================
Expand Down
3 changes: 2 additions & 1 deletion peps/pep-0791.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This PEP proposes a new submodule for number-theoretical, combinatorial and
other functions defined for integer arguments, like
:external+py3.14:func:`math.gcd` or :external+py3.14:func:`math.isqrt`.

.. _pep791-motivation:

Motivation
==========
Expand Down Expand Up @@ -160,7 +161,7 @@ content for older Python versions.
Possible Extensions
===================

New functions (like mentioned in `Motivation <Motivation_>`_ section) are not
New functions (like mentioned in :ref:`pep791-motivation` section) are not
part of this proposal.

Though, we should mention that, unless we can just provide bindings to some
Expand Down
Loading
Loading