Mar-06-2022, 10:32 PM
I'm try override dict class for way that compatible with standart dict class. How i can get access to parent dict attribute if i override getitem method?
Then i faced error:
1 2 3 4 |
class CSJSON( dict ): def __getitem__( self , Key : str ): Key = Key + 'zzz' # sample of key modification for app use return ( super ()[Key]) |
Error:'super' object is not subscriptable.
If i'm use self[Key] - then i get infinite recursive call of getitem.