Currently the parse method of Command objects expects a message of type bytes; if needed, the Command then has to deal with decoding the message, which feels slightly awkward. This also results in a type error (that happens to sneak past MyPy) in CommandInterpreter where parse is passed a message as an AnyStr.
With the introduction of DecodingInterpreter in #91 , decoding logic can be removed from RegexCommand, which should allow for commands to parse a generic AnyStr. (We actually don't need to move the decoding logic to achieve this)
This change will break some of the examples, these will need updating. (Not necessary)
Currently the
parse
method ofCommand
objects expects a message of typebytes
; if needed, theCommand
then has to deal with decoding the message, which feels slightly awkward. This also results in a type error (that happens to sneak past MyPy) inCommandInterpreter
whereparse
is passed a message as anAnyStr
.With the introduction of(We actually don't need to move the decoding logic to achieve this)DecodingInterpreter
in #91 , decoding logic can be removed fromRegexCommand
, which should allow for commands to parse a genericAnyStr
.This change will break some of the examples, these will need updating.(Not necessary)