Skip to content

Commit

Permalink
Merge branch 'python:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
smontanaro committed Feb 4, 2024
2 parents ac243ea + 80734a6 commit 57b1109
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
19 changes: 18 additions & 1 deletion Doc/howto/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,30 @@ the :meth:`~Enum.__repr__` omits the inherited class' name. For example::
>>> Creature.DOG
<Creature.DOG: size='medium', legs=4>

Use the :func:`!dataclass` argument ``repr=False``
Use the :func:`~dataclasses.dataclass` argument ``repr=False``
to use the standard :func:`repr`.

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

.. note::

Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum`
and its subclasses is not supported. It will not raise any errors,
but it will produce very strange results at runtime, such as members
being equal to each other::

>>> @dataclass # don't do this: it does not make any sense
... class Color(Enum):
... RED = 1
... BLUE = 2
...
>>> Color.RED is Color.BLUE
False
>>> Color.RED == Color.BLUE # problem is here: they should not be equal
True


Pickling
--------
Expand Down
13 changes: 12 additions & 1 deletion Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2643,7 +2643,18 @@ config.status: $(srcdir)/configure
Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<

Python/jit.o: regen-jit

JIT_DEPS = \
$(srcdir)/Tools/jit/*.c \
$(srcdir)/Tools/jit/*.py \
$(srcdir)/Python/executor_cases.c.h \
pyconfig.h

jit_stencils.h: $(JIT_DEPS)
@REGEN_JIT_COMMAND@

Python/jit.o: $(srcdir)/Python/jit.c @JIT_STENCILS_H@
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<

.PHONY: regen-jit
regen-jit:
Expand Down
2 changes: 1 addition & 1 deletion Tools/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ embuilder --pic build zlib bzip2 MINIMAL_PIC
```


#### Compile a build Python interpreter
### Compile and build Python interpreter

From within the container, run the following command:

Expand Down
3 changes: 3 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1592,11 +1592,13 @@ AS_VAR_IF([enable_experimental_jit],
[AS_VAR_APPEND([CFLAGS_NODIST], [" -D_Py_JIT"])
AS_VAR_SET([REGEN_JIT_COMMAND],
["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"])
AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
AS_VAR_IF([Py_DEBUG],
[true],
[AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --debug"])],
[])])
AC_SUBST([REGEN_JIT_COMMAND])
AC_SUBST([JIT_STENCILS_H])
AC_MSG_RESULT([$enable_experimental_jit])

# Enable optimization flags
Expand Down

0 comments on commit 57b1109

Please sign in to comment.