[Python-Dev] Misc re.match() complaint (original) (raw)
Serhiy Storchaka storchaka at gmail.com
Wed Jul 17 15:12:34 CEST 2013
- Previous message: [Python-Dev] Misc re.match() complaint
- Next message: [Python-Dev] Misc re.match() complaint
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
16.07.13 20:21, Guido van Rossum написав(ла):
The situation is most egregious if the target string is a bytearray, where there is currently no way to get the result as an immutable bytes object without an extra copy. (There's no API that lets you create a bytes object directly from a slice of a bytearray.)
m = memoryview(data) if m: return m.cast('B')[low:high].tobytes() else: # cast() doesn't work for empty memoryview return b''
- Previous message: [Python-Dev] Misc re.match() complaint
- Next message: [Python-Dev] Misc re.match() complaint
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]