[issue1282] re module needs to support bytes / memoryview well

Serhiy Storchaka report at bugs.python.org
Sat Nov 8 14:16:22 CET 2014


Serhiy Storchaka added the comment:

Actually non-hashable patterns are not supported.

>>> re.match(bytearray(b'.'), b'x')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/re.py", line 163, in match
    return _compile(pattern, flags).match(string)
  File "/home/serhiy/py/cpython/Lib/re.py", line 281, in _compile
    p, loc = _cache[type(pattern), pattern, flags]
TypeError: unhashable type: 'bytearray'

Should it be considered as a bug?

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1282>
_______________________________________


More information about the Python-bugs-list mailing list