Skip to content

Commit 57b1109

Browse files
authored
Merge branch 'python:main' into main
2 parents ac243ea + 80734a6 commit 57b1109

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

Doc/howto/enum.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,30 @@ the :meth:`~Enum.__repr__` omits the inherited class' name. For example::
497497
>>> Creature.DOG
498498
<Creature.DOG: size='medium', legs=4>
499499

500-
Use the :func:`!dataclass` argument ``repr=False``
500+
Use the :func:`~dataclasses.dataclass` argument ``repr=False``
501501
to use the standard :func:`repr`.
502502

503503
.. versionchanged:: 3.12
504504
Only the dataclass fields are shown in the value area, not the dataclass'
505505
name.
506506

507+
.. note::
508+
509+
Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum`
510+
and its subclasses is not supported. It will not raise any errors,
511+
but it will produce very strange results at runtime, such as members
512+
being equal to each other::
513+
514+
>>> @dataclass # don't do this: it does not make any sense
515+
... class Color(Enum):
516+
... RED = 1
517+
... BLUE = 2
518+
...
519+
>>> Color.RED is Color.BLUE
520+
False
521+
>>> Color.RED == Color.BLUE # problem is here: they should not be equal
522+
True
523+
507524

508525
Pickling
509526
--------

Makefile.pre.in

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,18 @@ config.status: $(srcdir)/configure
26432643
Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S
26442644
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
26452645

2646-
Python/jit.o: regen-jit
2646+
2647+
JIT_DEPS = \
2648+
$(srcdir)/Tools/jit/*.c \
2649+
$(srcdir)/Tools/jit/*.py \
2650+
$(srcdir)/Python/executor_cases.c.h \
2651+
pyconfig.h
2652+
2653+
jit_stencils.h: $(JIT_DEPS)
2654+
@REGEN_JIT_COMMAND@
2655+
2656+
Python/jit.o: $(srcdir)/Python/jit.c @JIT_STENCILS_H@
2657+
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
26472658

26482659
.PHONY: regen-jit
26492660
regen-jit:

Tools/wasm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ embuilder --pic build zlib bzip2 MINIMAL_PIC
8383
```
8484

8585

86-
#### Compile a build Python interpreter
86+
### Compile and build Python interpreter
8787

8888
From within the container, run the following command:
8989

configure

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,11 +1592,13 @@ AS_VAR_IF([enable_experimental_jit],
15921592
[AS_VAR_APPEND([CFLAGS_NODIST], [" -D_Py_JIT"])
15931593
AS_VAR_SET([REGEN_JIT_COMMAND],
15941594
["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"])
1595+
AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
15951596
AS_VAR_IF([Py_DEBUG],
15961597
[true],
15971598
[AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --debug"])],
15981599
[])])
15991600
AC_SUBST([REGEN_JIT_COMMAND])
1601+
AC_SUBST([JIT_STENCILS_H])
16001602
AC_MSG_RESULT([$enable_experimental_jit])
16011603

16021604
# Enable optimization flags

0 commit comments

Comments
 (0)