You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-06-10.08:02:04.009>created_at=<Date2019-04-07.10:28:01.405>labels= ['expert-regex', '3.8', 'type-feature', 'library']
title='Make the repr of re flags more readable'updated_at=<Date2019-06-10.08:02:04.009>user='https://github.com/serhiy-storchaka'
Activity
serhiy-storchaka commentedon Apr 7, 2019
Currently the repr of re flags contains the name of the private class and it is not an evaluable expression:
The repr of inverted flags is even more verbose:
The result of str() starves from the same issues.
If the value contains unrecognized flags, it looks even more weird, and this information is not shown for invered flags:
This repr is also not consistent with the represenation of flags in the repr of the compiled pattern:
The proposed PR makes the repr be the same as for flags in the repr of the compiled pattern and represents inverted flags as the result of inversion:
__str__ is set to object.__str__, so that str() will return the same as repr().
serhiy-storchaka commentedon May 31, 2019
New changeset 14a0e16 by Serhiy Storchaka in branch 'master':
bpo-36548: Improve the repr of re flags. (GH-12715)
14a0e16