Ezio Melotti <ezio.melo...@gmail.com> added the comment:

Also note that some behaviors are not "old" or "compatible", but just 
different.  For example why inline flags should be the old (or new) behavior?  
Or e.g. the behavior of version 2 but not 0 and 1?
Also what if I want zero-width splits but not nested sets and sets operations?  
Or if I want inline flags but not zero-width splits?

A new set of "features" flags might be an alternative approach.  It will also 
make possible to add new features that are not backward compatible that can be 
turned on explicitly with their flag.

It would be fine for me if I had to turn on explicitly e.g. nested sets if/when 
I'll need to use them, and keep having the "normal" behavior otherwise.

OTOH there are three problems with these approach:
  1) it's not compatible with regex (I guess people will use the external 
module in Python <3.3 and the included one in 3.3+, probably expecting the same 
semantics).  This is also true with the OLD/COMPAT flag though;
  2) it might require other inline feature-flags;
  3) the new set of flags might be added to the other flags or be separate, so 
e.g. re.compile(pattern, flags=re.I|re.NESTEDSETS) or re.compile(pattern, 
flags=re.I, features=re.NESTEDSETS).  I'm not sure it's a good idea to add 
another arg though.

Matthew, is there a comprehensive list of all the bugfix/features that have a 
different behavior from re?
We should first check what changes are acceptable and what aren't, and 
depending on how many and what they are we can then decide what is the best 
approach (a catch-all flag or several flags to change the behavior, transition 
period + warning before setting it as default, etc.)

----------

_______________________________________
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