hdl.ast: allow typed int enums in Value.cast.
This commit is contained in:
parent
91d4513682
commit
58a0c68279
3 changed files with 31 additions and 4 deletions
|
|
@ -235,6 +235,9 @@ Casting a value from an integer ``i`` is a shorthand for ``Const(i)``:
|
|||
>>> Value.cast(5)
|
||||
(const 3'd5)
|
||||
|
||||
.. note::
|
||||
|
||||
If a value subclasses :class:`enum.IntEnum` or its class otherwise inherits from both :class:`int` and :class:`Enum`, it is treated as an enumeration.
|
||||
|
||||
Values from enumeration members
|
||||
-------------------------------
|
||||
|
|
@ -247,6 +250,10 @@ Casting a value from an enumeration member ``m`` is a shorthand for ``Const(m.va
|
|||
(const 2'd1)
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
If a value subclasses :class:`enum.IntEnum` or its class otherwise inherits from both :class:`int` and :class:`Enum`, it is treated as an enumeration.
|
||||
|
||||
.. _lang-signals:
|
||||
|
||||
Signals
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue