Python namedtuple:类型名称和字段名称必须是有效的标识符:'480w_still'

Python namedtuple: Type names and field names must be valid identifiers: '480w_still'

我正在尝试将 namedtuple 与 dict 对象一起使用以将 dict 转换为自定义 class,但我遇到了问题。使用时

self.images = namedtuple('Images', json["images"].keys())(*json["images"].values())

引发此异常:

ValueError: Type names and field names must be valid identifiers: '480w_still'

我看到有人遇到这些错误,但没有找到解决方案,也没有找到关于 480w_still 的文档。任何人都可以帮助我这意味着什么,我该如何解决?谢谢。

完整的json是:

https://pastebin.com/PmSyBSkb

只有图片部分的json是:

https://pastebin.com/q3rWVmXa

谢谢。

来自 namedtuple 文档:

Any valid Python identifier may be used for a fieldname except for names starting with an underscore. Valid identifiers consist of letters, digits, and underscores but do not start with a digit or underscore and cannot be a keyword such as class, for, return, global, pass, print, or raise.

https://docs.python.org/2/library/collections.html#collections.namedtuple