Closed eric-wieser closed 7 years ago
I dislke the current code to validate instructions. The validation is delayed when you iterate on instructions. I would prefer to raise an error on .append(123) for example.
An option would be to modify InstrList to inherit from abc.MutableSequence instead of list, and implement the ABC using a private list. setitem() and insert() would validate that added items are instructions.
Ok, updated with those changes.
Aside from the abc.MutableSequence
change, which would probably do better as a new PR building on this, is this good to merge?
Also adds validation to
Bytecode