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

Add attrs validation to head, body, tail args on Parser #98

Open
bskinn opened this issue Oct 29, 2019 · 0 comments
Open

Add attrs validation to head, body, tail args on Parser #98

bskinn opened this issue Oct 29, 2019 · 0 comments
Milestone

Comments

@bskinn
Copy link
Owner

bskinn commented Oct 29, 2019

No real validation currently for head or tail.

The requirement for body being present currently relies on a ~hacky call to .pattern(), ultimately hitting this error.

Far better to just validate all three more consistently. An attrs validator won't work, because they could be instances of Parser, and that will be challenging to put into the main class body. Probably better to use instanceof(..., self.__class__) inside __attrs_post_init__.

head and tail could be None, str, Parser, or Iterable(? Collection? Sequence? Also, how to ensure str contents? Don't bother checking contents?); body is the same, save None is not allowed.

@bskinn bskinn added this to the v0.3 milestone Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant