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 <rep...@bugs.python.org>
<http://bugs.python.org/issue1282>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to