我正在使用Python是本机脚本语言的程序。不幸的是,它们具有使用name的本机函数bytes
。当我尝试使用实际的bytes
内置函数时,这会导致出现问题,并且认为我正在引用该内置变量。我将用下面的内置代码向您展示我的意思:一个对象:
def receive(row, table, message, bytes):
#This is defined in the GUI
所以row
,table
,message
,并且bytes
都作为参数传入,有效覆盖名bytes
。所以如果我说bytes(something).decode()
我得到一个TypeError: 'bytes' object is not callable
有什么办法摆脱这种困境?
为第四个参数使用其他名称(如果可以更改函数的签名)
def receive(row, table, message, bytes_):
#This is defined in the GUI
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句