AttributeError: 'set' object has no attribute 'items' AttributeError: 'set' object has no attribute 'items' python python

AttributeError: 'set' object has no attribute 'items'


As you can see from the latest updated code -

self.changes = {"MTMA",123}

When you define self.changes as above , you are actually defining a set , not a dictionary , since you used ',' (comma) instead of colon , I am pretty sure in your actual code you are using comma itself , not colon .

To define a dictionary with "MTMA" as key and 123 as value , use a colon in between them , Example -

self.changes = {"MTMA":123}

Do similarly in your actual code as well.

If what you want is an empty dictionary , define it as -

self.changes = {}