We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If the constant starts with a numeral (potentially other non-alpha too), the CHOICES. construct doesn't work.
Steps to reproduce.
>>> STATES = Choices(('ONLINE','1-2', 'Online'),('OFFLINE','2-1', 'Offline'),) >>> STATES.constants {'ONLINE': ('ONLINE', '1-2', 'Online'), 'OFFLINE': ('OFFLINE', '2-1', 'Offline')} >>> STATES.ONLINE '1-2' >>> STATES = Choices(('1ONLINE','1-2', 'Online'),('2OFFLINE','2-1', 'Offline'),) >>> STATES.constants {'1ONLINE': ('1ONLINE', '1-2', 'Online'), '2OFFLINE': ('2OFFLINE', '2-1', 'Offline')} >>> STATES.1ONLINE File "<console>", line 1 STATES.1ONLINE ^ SyntaxError: invalid syntax
The text was updated successfully, but these errors were encountered:
It's logic because the goal of the constant is to create an attribute. So it will never be possible, but it should raise an error at definition time.
Thanks for the report
Sorry, something went wrong.
No branches or pull requests
If the constant starts with a numeral (potentially other non-alpha too), the CHOICES. construct doesn't work.
Steps to reproduce.
The text was updated successfully, but these errors were encountered: