Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Command to parse AnyStr #92

Closed
MattPrit opened this issue Sep 1, 2022 · 0 comments
Closed

Allow Command to parse AnyStr #92

MattPrit opened this issue Sep 1, 2022 · 0 comments

Comments

@MattPrit
Copy link
Collaborator

MattPrit commented Sep 1, 2022

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)

@abbiemery abbiemery closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants