Closed hannesha closed 1 year ago
Record
s are going to be deprecated and removed on a very aggressive schedule so I don't see this as being worth fixing.
Is there going to be a Interface replacement for Record
before its removal?
Modeling Interfaces is the only remaining use-case of Record
since the introduction of aggregate types.
Yes, Records will be removed simultaneously with introducing a replacement, and they will coexist for one release cycle. (This is how Amaranth always does removal of anything that's been in a release.)
Great, Thanks. I'll try out the replacement once it's implemented.
Should I keep this issue open?
I think we can close this as not planned.
Since RFC 15, using aggregate types inside
Record
is possible.Consider the following code:
Causes an exception in
Record.connect()
:When using a
Layout
in theRecord
constructor yields the following error instead:Defining the or operator with
__or__
works for structs as a workaround. However it isn't possible to do this for Layouts.Another possibility is to get the underlying shape with
.as_shape()
and access the field with views. This kind of defeats the convenience of using a struct though.