Vlastimil Brom <vlastimil.b...@gmail.com> added the comment:

I'd agree with Steven ( msg143377 ) and others, that there probably shouldn't 
be a large library-specific set of new tags just for "housekeeping" purposes 
between re and regex. I would personally prefer, that these tags also be 
settable in the pattern (?...), which would probably be problematic with 
versioned flags.

Although I am trying to take advantage of the new additions, if applicable, I 
agree, that there should be a possibility to use regex in an unreflected way 
with the same behaviour like re (maybe except for the fixes of what will be 
agreed on to be a bug (enough)).
On the other hand, it seems to me, that the enhancements/additions can be 
enabled at once, as an user upgrading the regexes for the new library 
consciously (or a new user not knowing re) can be supposed to know the new 
features and their implications. I guess, it is mostly trivially possible to 
fix/disambiguate the problematic patterns, e.g. by escaping.

As for setting the new/old behaviour, would there be a possibility to 
distinguish it just by importing (possibly through some magic, without the need 
to duplicate the code?), 
import re_in_compat_mode as re
vs:
import re_with_all_the_new_features as re

Unfortunately, i have no idea, whether this is possible or viable...
with this option, the (user) code update could be just the change of the 
imports instead of adding the flags to all relevant places (and to take them 
away as redundant, as the defaults evolve with the versions...).

However, it is not clear, how this "aliasing" would work out with regard to the 
transition, maybe the long differenciated "module" names could be kept and the 
meaning of "import re" would  change, allong with the previous warnings, in 
some future version.

just a few thoughts...
   vbr

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to