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 a custom set of characters in a token #87

Merged
merged 1 commit into from
Oct 4, 2019

Conversation

carpie
Copy link
Contributor

@carpie carpie commented May 9, 2019

Here is a proposed way to handle issue #86.

@@ -114,7 +114,8 @@ class BooleanAlgebra(object):
"""

def __init__(self, TRUE_class=None, FALSE_class=None, Symbol_class=None,
NOT_class=None, AND_class=None, OR_class=None):
NOT_class=None, AND_class=None, OR_class=None,
allowed_in_token=('.', ':', '_')):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be better to provide a string that lists all allowed characters explicitly (including "alnum")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is good, but maybe not practical to match what alnum allows? According to the python docs, isalpha (part of alnum) matches any unicode character marked as 'Letter'. I'm not sure how many that is exactly, but probably more than one would want to specify.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Using a string vs a list is minor too. So I am merging as-is.
Thank you again!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@pombredanne pombredanne merged commit dd4bc01 into bastikr:master Oct 4, 2019
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 this pull request may close these issues.

2 participants