- Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
Description
I'm currently converting a JSON schema that uses Unicode codepoint properties like \p{L} in regex patterns.
These are one of the assorted JSON schema regex features that aren't supported by the standard library's re module, but are supported by the regex module.
Line 22222 in bc60e96
| temp_module = PyImport_ImportModule("re"); |
sys.modules cache while loading msgspec for the first time, but that kind of workaround is always annoyingly fragile, so it would be nice to have a supported way to say "use regex, not re". From a usage point of view, the simplest option would be if msgspec itself tried to import regex first, and treated re as a fallback if regex wasn't available.
Alternatively, potentially a module level API that allowed a reference to regex.compile to be passed in to update the cached re_compile reference in the module state.
Metadata
Metadata
Assignees
Labels
No labels