Hello BlenderArtists.
I appeal to anyone who has experience with the concept for the KX_GameObject type.
As you know, the object properties are now dictionary properties, not object attributes, however the GameObject isn’t behaving exactly like a dictionary - you can’t use this example;
Yes it has get, but not setdefault so you can’t set a value of a key if the key doesn’t exist, and setdefault is a standard dictionary method, so beleive it should be a part of objects methods
KX_GameObject behaves like a dictionary for attribute access, it doesn’t make it a dictionary. I assume getitem and setitem are simply an alias for ob.attrDict.getitem and ob.attrDict.setitem.
You should be able to use setdefault and all the other dictionary methods on ob.attrDict.