How do I test for the class of an instance? e.g., I used to test for a dictionary: if type(aContainer) == type({}): However, this seems awkward and wasteful.