Skip to content

Commit 2acd7a9

Browse files
Merge branch 'main' into bitfields
2 parents 61b0b7f + 454a6d6 commit 2acd7a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+834
-1527
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# It uses the same pattern rule for gitignore file
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

7+
# GitHub
8+
.github/** @ezio-melotti
9+
710
# asyncio
811
**/*asyncio* @1st1 @asvetlov @gvanrossum
912

.github/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ also suggestions on how you can most effectively help the project.
3838

3939
Please be aware that our workflow does deviate slightly from the typical GitHub
4040
project. Details on how to properly submit a pull request are covered in
41-
`Lifecycle of a Pull Request <https://devguide.python.org/pullrequest/>`_.
41+
`Lifecycle of a Pull Request <https://devguide.python.org/getting-started/pull-request-lifecycle.html>`_.
4242
We utilize various bots and status checks to help with this, so do follow the
4343
comments they leave and their "Details" links, respectively. The key points of
4444
our workflow that are not covered by a bot or status check are:

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ on:
2525
permissions:
2626
contents: read
2727

28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
30+
cancel-in-progress: true
31+
2832
jobs:
2933
check_source:
3034
name: 'Check for source changes'

.github/workflows/build_msi.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
permissions:
1919
contents: read
2020

21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226
build:
2327
name: Windows Installer

.github/workflows/doc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ on:
2828
permissions:
2929
contents: read
3030

31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
33+
cancel-in-progress: true
34+
3135
jobs:
3236
build_doc:
3337
name: 'Docs'

.github/workflows/project-updater.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- opened
77
- labeled
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
add-to-project:
1114
name: Add issues to projects

.github/workflows/verify-ensurepip-wheels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
permissions:
1717
contents: read
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
1923
jobs:
2024
verify:
2125
runs-on: ubuntu-latest

Doc/c-api/buffer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
9999
For :term:`contiguous` arrays, the value points to the beginning of
100100
the memory block.
101101

102-
.. c:member:: void *obj
102+
.. c:member:: PyObject *obj
103103
104104
A new reference to the exporting object. The reference is owned by
105105
the consumer and automatically decremented and set to ``NULL`` by

Doc/c-api/memoryview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ any other object.
5555
*mview* **must** be a memoryview instance; this macro doesn't check its type,
5656
you must do it yourself or you will risk crashes.
5757
58-
.. c:function:: Py_buffer *PyMemoryView_GET_BASE(PyObject *mview)
58+
.. c:function:: PyObject *PyMemoryView_GET_BASE(PyObject *mview)
5959
6060
Return either a pointer to the exporting object that the memoryview is based
6161
on or ``NULL`` if the memoryview has been created by one of the functions

Doc/howto/descriptor.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ afterwards, :meth:`__set_name__` will need to be called manually.
847847
ORM example
848848
-----------
849849

850-
The following code is simplified skeleton showing how data descriptors could
850+
The following code is a simplified skeleton showing how data descriptors could
851851
be used to implement an `object relational mapping
852852
<https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping>`_.
853853

@@ -1535,6 +1535,8 @@ by member descriptors:
15351535
def __get__(self, obj, objtype=None):
15361536
'Emulate member_get() in Objects/descrobject.c'
15371537
# Also see PyMember_GetOne() in Python/structmember.c
1538+
if obj is None:
1539+
return self
15381540
value = obj._slotvalues[self.offset]
15391541
if value is null:
15401542
raise AttributeError(self.name)
@@ -1563,13 +1565,13 @@ variables:
15631565
class Type(type):
15641566
'Simulate how the type metaclass adds member objects for slots'
15651567

1566-
def __new__(mcls, clsname, bases, mapping):
1568+
def __new__(mcls, clsname, bases, mapping, **kwargs):
15671569
'Emulate type_new() in Objects/typeobject.c'
15681570
# type_new() calls PyTypeReady() which calls add_methods()
15691571
slot_names = mapping.get('slot_names', [])
15701572
for offset, name in enumerate(slot_names):
15711573
mapping[name] = Member(name, clsname, offset)
1572-
return type.__new__(mcls, clsname, bases, mapping)
1574+
return type.__new__(mcls, clsname, bases, mapping, **kwargs)
15731575
15741576
The :meth:`object.__new__` method takes care of creating instances that have
15751577
slots instead of an instance dictionary. Here is a rough simulation in pure
@@ -1580,7 +1582,7 @@ Python:
15801582
class Object:
15811583
'Simulate how object.__new__() allocates memory for __slots__'
15821584

1583-
def __new__(cls, *args):
1585+
def __new__(cls, *args, **kwargs):
15841586
'Emulate object_new() in Objects/typeobject.c'
15851587
inst = super().__new__(cls)
15861588
if hasattr(cls, 'slot_names'):
@@ -1593,7 +1595,7 @@ Python:
15931595
cls = type(self)
15941596
if hasattr(cls, 'slot_names') and name not in cls.slot_names:
15951597
raise AttributeError(
1596-
f'{type(self).__name__!r} object has no attribute {name!r}'
1598+
f'{cls.__name__!r} object has no attribute {name!r}'
15971599
)
15981600
super().__setattr__(name, value)
15991601

@@ -1602,7 +1604,7 @@ Python:
16021604
cls = type(self)
16031605
if hasattr(cls, 'slot_names') and name not in cls.slot_names:
16041606
raise AttributeError(
1605-
f'{type(self).__name__!r} object has no attribute {name!r}'
1607+
f'{cls.__name__!r} object has no attribute {name!r}'
16061608
)
16071609
super().__delattr__(name)
16081610

0 commit comments

Comments
 (0)