[Python-3000] Regular expressions, py3k and unicode
Antoine Pitrou
solipsis at pitrou.net
Sun Jun 29 12:08:42 CEST 2008
Nick Coghlan <ncoghlan <at> gmail.com> writes:
> > Would there be any reason (I do not know) to replace that with an
> > re.ASCII flag to have the reverse effect (assuming there is not now)?
>
> I'd be inclined to have it implied by the type of the argument - a str
> argument implies re.UNICODE is set, a bytes or bytearray argument
> implies it isn't. Users could still set it explicitly to have it apply
> in the latter case.
Setting a hypothetical re.ASCII flag with a str pattern can have a sense, but
setting re.UNICODE with a bytes pattern doesn't have any (assuming we forbid
matching of bytes patterns with str objects and vice-versa).
More information about the Python-3000
mailing list