✨ Comprehensive bounds checking for event values
- Dominant language
- Python
- Stars
- 212
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
### Problem
Till 2.2.0, non-`DATA` events had a value setter. In 2.2.0, I removed event value lazy evaluation entirely.
Now `value` is an attribute of `EventBase`. Structs as part of list events or child level structs didn't invoke any setters, as they were just dictionaries.
The earlier property setter failed with a `ConstructError` or `struct.Error` which was non descriptive of what really caused it.
### Ideas
Make `EventBase.value` a descriptor again. Instead of doing everything in `EventBase` *ctor*, shift the parsing logic to subclasses.
Make this descriptor take in a validator class. For struct-based events, wrap the parsed Container into a special dictionary descriptor which validates every \_\_setitem\_\_ with the correct construct.
List event values could have their own list descriptor wrapper over the struct dictionary descriptors.
Contributor guide
Assessment
This issue has not been assessed yet.