From cfd4f9c84e6e7f89f4748434d21551f112704e73 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 31 Aug 2023 01:02:45 +0000 Subject: [PATCH] docs/enum: emphasize that `shape=` is optional. --- docs/stdlib/enum.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/stdlib/enum.rst b/docs/stdlib/enum.rst index e1f9da0..6f6897b 100644 --- a/docs/stdlib/enum.rst +++ b/docs/stdlib/enum.rst @@ -45,7 +45,17 @@ Any :ref:`constant-castable ` expression can be used as the v >>> Instr.SUBI -This module is a drop-in replacement for the standard :mod:`enum` module, and re-exports all of its members (not just the ones described below). In an Amaranth project, all ``import enum`` statements may be replaced with ``from amaranth.lib import enum``. +The ``shape=`` argument is optional. If not specified, classes from this module behave exactly the same as classes from the standard :mod:`enum` module, and likewise, this module re-exports everything exported by the standard :mod:`enum` module. + +.. testcode:: + + import amaranth.lib.enum + + class NormalEnum(amaranth.lib.enum.Enum): + SPAM = 0 + HAM = 1 + +In this way, this module is a drop-in replacement for the standard :mod:`enum` module, and in an Amaranth project, all ``import enum`` statements may be replaced with ``from amaranth.lib import enum``. Metaclass