Hi there,
I'm experimenting with a type-only/instanceless design for my library and I would love to get your opinions on such design.
The Goal is:
Replace command groups with a pure class-based approach (more data structure friendly), using metaclasses, no instance needed.
Code available at: https://paste.pythondiscord.com/OBSA
It allows the following synthax: (the same than the instance based one)
GroupModes["ENGINE_SPEED"]
Mode01[0x0C]
# Access modes by enum or int
GroupModes[Mode.REQUEST] # Returns Mode01 class
GroupModes[1]
# Iteration works directly on classes
for cmd in GroupModes:
print(cmd)
# Length and containment checks
len(Mode01)
"ENGINE_SPEED" in Mode01