8000 docs: re.compile(...) fails due ops > 127 but the error is misleading · Issue #17150 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

docs: re.compile(...) fails due ops > 127 but the error is misleading #17150

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

Open
WebReflection opened this issue Apr 17, 2025 · 0 comments
Open
Labels
docs py-core Relates to py/ directory in source

Comments

@WebReflection
Copy link

Documentation URL

No response

Description

Apparently this is expected to fail:

import re

# this works
re.compile('^(?:a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v)$')

# this fails
re.compile('^(?:a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w)$')

but at least the error could hint that's because there are too many operations to handle, instead of:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: error in regex

'cause there is no error, strictly speaking, in that regex, it's a hard (default) limitation on MicroPython side.

Thanks.

Code of Conduct

Yes, I agree

@WebReflection WebReflection changed the title docs: re,compile fails due ops > 127 but the error is misleading docs: re.compile(...) fails due ops > 127 but the error is misleading Apr 17, 2025
@jonnor jonnor added py-core Relates to py/ directory in source docs labels Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs py-core Relates to py/ directory in source
Projects
None yet
Development

No branches or pull requests

2 participants
0