>>> import unicodedata
>>> unicodedata.lookup(b'SNAKE') # `lookup` happens to use the s# format internally
'🐍'
>>> view = memoryview(b'SNAKE')
>>> view.readonly
True
>>> unicodedata.lookup(view)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: lookup() argument must be read-only bytes-like object, not memoryview
The docs should explain the semantics precisely, without overwhelming the user that just wants to take str/bytes.