I am working on an old Python codebase. I am not in contact with anyone who had worked on the codebase previously, so I do not know why the previous developers did what they did.
In the codebase, there is a "blank" class which is used in a similar way as a dictionary. Here is a simplified example.
# Defining a "blank" class
class blank:
pass
items = blank()
# There is a function to "add" to items by using setattr
def addItem(name, item):
setattr(items, name, item)
addItem("att1", obj1)
addItem("att2", obj2)
# Later, items is used like this
items.att1.someFunction()
items.att2.otherFunction()
What are the advantages or disadvantages, if any, of using a class in this way instead of a dictionary?