Dynamic class creation with type and __slots__?
问题 When creating result objects within a class, is it possible to use __slots__ in this example? I thought I could get it to work by passing '__slots__' into the dictionary for the third argument to type : class GeocodeResult(object): """class to handle Reverse Geocode Result""" __slots__ = ['geometry', 'response', 'spatialReference', 'candidates', 'locations', 'address', 'type', 'results'] def __init__(self, res_dict, geo_type): RequestError(res_dict) self.response = res_dict self.type = 'esri_