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

Documentation inaccurately describes "letter" #59

Open
mcclure opened this issue Nov 26, 2015 · 0 comments
Open

Documentation inaccurately describes "letter" #59

mcclure opened this issue Nov 26, 2015 · 0 comments

Comments

@mcclure
Copy link

mcclure commented Nov 26, 2015

In general, Parsley seems to not be very aware of Unicode. A specific manifestation of this problem, the documentation says:

letter:
    Matches a single ASCII letter.

However, looking at the source code, I think it is doing something different. Looking at runtime.py, the class OMetaBase, the method letter() is implemented by calling str.isalpha(). The Python documentation describes isalpha as:
Python 2.7: Depends on locale
Python 3.5: Union of several Unicode categories

In other words, unless I am misunderstanding the source, the characters matched by letter will depend on version of Python and in version 2.7 will depend on locale. This should be documented.

ws and digit have similar problems, btw. The ws documentation says it "matches zero or more spaces, tabs, or newlines" but the implementation in the source appears to use str.isspace(), which has similar behavior to isalpha.

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

No branches or pull requests

1 participant