I have below an object:
class A:
a:str
b:str
c:str
And the dictionary is as below:
d = {"a":"abc","b":"def","d":"itf"}
After populating the dictionary in the object, params a
and b
should be "abc"
and "def"
and d
should be discarded and c
should be None.
How can I achieve this?
Edit: i want to set instance attributes not class attributes in class A.