-
Notifications
You must be signed in to change notification settings - Fork 451
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
Pint should validate aliases #1918
Comments
I agree. Alias and unit names must be validated. I think they must follow the same rules as python identifiers. |
The unit names are already properly validated. So validation code is already written just not applied to aliases. |
indeed! Will fix it! |
The code is there already Just need to swap the function for But I agree with you, an alias should follow the same rule as a unit name. |
It turns out it is not so easy. Some alias that we want to have like >>> str.isidentifier("°C")
False |
Currently it is possible to define invalid and unusable aliases. In contrast to unit names, alias names are obviously not sufficiently validated.
The text was updated successfully, but these errors were encountered: