Barry A. Warsaw <ba...@python.org> added the comment: On Oct 4, 2017, at 02:29, INADA Naoki <rep...@bugs.python.org> wrote: > > INADA Naoki <songofaca...@gmail.com> added the comment: > >> Yet one way -- make re.ASCII a local flag. Than we could just change the >> idpattern attribute to r'(?a:[_a-z][_a-z0-9]*)', without touching the flags >> attribute. > > https://docs.python.org/3.6/library/re.html#regular-expression-syntax says > `(?imsx-imsx:...)` > > Anyway, Template.idpattern is documented public API too.
Too bad, because I like that approach. How hard would it be to add support for ‘a’ as a local flag? (I’m kind of surprised that it isn’t already supported - it seems like it would be useful.) I would like this better than hacking Template.flags after the fact. It seems like the right way to align the code with the documentation (i.e. fix a bug). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31672> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com