我想删除函数中bytes
参数的元素。我希望更改参数,而不是返回新对象。
def f(b: bytes):
b.pop(0) # does not work on bytes
del b[0] # deleting not supported by _bytes_
b = b[1:] # creates a copy of b and saves it as a local variable
io.BytesIO(b).read(1) # same as b[1:]
这里有什么解决办法?
Tags:
目前没有回答
相关问题 更多 >
编程相关推荐