我正在使用mypy和一些基本的Python迭代,并编写了下面的代码库:from datetime import date, timedelta_total_dates)
print(f"Calling getitem with value of index" (not iterable)
Found 3 errors in 1 file (checked 1 source fil
各位圣诞快乐, 我正在实现一个允许属性访问的自定义字典,例如dct.attribute。字典可以嵌套,因此dct.nested_dct.attribute也应该是可能的。我认为我能够用代码比文字更好地表达我正在尝试做的事情。这就是我正在编写的类。__getitem__(item)
item = super().__getitem__(item)
if i