Open alexfikl opened 3 years ago
For the use case, could you simply stuff the extra fields into another dataclass that's not an array container? (And send them "along for the ride" that way?)
For the use case, could you simply stuff the extra fields into another dataclass that's not an array container? (And send them "along for the ride" that way?)
Yeah, I ended up doing a combination of that and some memoizing, since otherwise they would get out of sync.
In that case, I'd say let's hold off here. I won't close it, but I'll add a "shelved" tag.
@inducer Tried to use that Annotated
type to explicitly exclude fields from the dataclass and it seems to be working quite nicely. Don't have a Python 3.6 environment to check that it works there too, but it should if typing_extensions
works as advertised.
This isn't as nice as it could be due to backwards compatibility, but it seems to work.
EDIT: Actually, this doesn't work for what I wanted to use it for. I'll leave it here in case you think it's still useful, but otherwise feel free to close!