I want to add a dictionary that maps an object to a list of objects as an instance variable to a class. What is the idiomatic way to do it in Python? Here’s how I’ve done it:
class MyClass:
def __init__(self):
self.myDict = { None : [None] }
You have already hit upon the idiomatic way to do it!