Could not reproduce locally but this was reported to fix a recursion
happening easily by creating a document and cloning it.
This avoids any recursion by punting to the enum equallity operator
directly and once, mapping the other parameter optionally.
from
https://docs.python.org/2/library/re.html?highlight=regular%20expressions#contents-of-module-re
re.U
re.UNICODE
Make \w, \W, \b, \B, \d, \D, \s and \S dependent on the Unicode
character properties database.
New in version 2.0.