Message260072
Once a regular expression is compiled with `obj = re.compile()`, it would be nice to have access to the raw bytecode, probably as `obj.code` or `obj.bytecode`, so it can be explored programmatically. Currently, regex bytecode is only stored in a C struct and not exposed to Python code; the only way to examine the compiled version is to pass the `re.DEBUG` flag to `re.compile()`, which prints only to stdout and outputs not the finished bytecode, but a "pretty-printed" intermediate representation useless for programmatic analysis.
This is basically requesting the equivalent of the `co_code` attribute of the code object returned by the built-in `compile()`, but for regular expression objects instead of Python code objects.
Given that the bytecode can actually be multi-byte integers, `regexobj.bytecode` should return a list (perhaps even just the same list passed to the C function?) or an `array.array()` instance, rather than a bytestring. |
|
Date |
User |
Action |
Args |
2016-02-11 04:05:27 | jcgoble3 | set | recipients:
+ jcgoble3, pitrou, ezio.melotti, mrabarnett, serhiy.storchaka |
2016-02-11 04:05:27 | jcgoble3 | set | messageid: <1455163527.75.0.996534901196.issue26336@psf.upfronthosting.co.za> |
2016-02-11 04:05:27 | jcgoble3 | link | issue26336 messages |
2016-02-11 04:05:26 | jcgoble3 | create | |
|