Python 我有一张单子,尽管我一直得到“我有一张单子”类型为'的参数;str';是不合适的”;

Python 我有一张单子,尽管我一直得到“我有一张单子”类型为'的参数;str';是不合适的”;,python,ironpython,Python,Ironpython,我为这件事伤了脑筋,因为这是一个看起来不应该存在的错误 我经常遇到的错误是: Exception: IronPython.Runtime.Exceptions.TypeErrorException: argument of type 'str' is not iterable at CallSite.Target(Closure , CallSite , Object , Object ) 代码部分是: newAssetDataRows = filter(lambda row: row.Get

我为这件事伤了脑筋,因为这是一个看起来不应该存在的错误

我经常遇到的错误是:

Exception: IronPython.Runtime.Exceptions.TypeErrorException: argument of type 'str' is not iterable
at CallSite.Target(Closure , CallSite , Object , Object )
代码部分是:

newAssetDataRows = filter(lambda row: row.GetColumnByName('Original number').Value != '' and row.GetColumnByName('Item Id').Value != '' and row.GetColumnByName('Parent Id').Value == '', assetDataContainer.Rows)
Log.Write("newAssetDataRows length: " + str(len(newAssetDataRows)))
for row in newAssetDataRows:
当到达for命令时,脚本中断


log函数将“newAssetDataRows length:0”写入日志。

听起来好像没有任何内容被输入到newAssetDataRows中……如果
newAssetDataRows
length是
0
您希望在整个过程中迭代什么,但是脚本是否应该中断,以及我收到的消息?有趣的异常是,您在那里遇到了,因为
str
实际上是错误的,Python可能会在该错误中报告错误的类型: