def __init__(self):
					"""The attributes for the virtual container"""
					#Define the default values
					__vals__=OrderedDict([(key,None) for key in objects_type])
					#Then function to access them. Note the default parameter for the lambda to
					#enforce early binding
					d={}
					for key in objects_type:
						def func_factory(key):
							"""Function causes early binding for key"""
							def make_attribute(self, items=None):
								"""Called on the attr_cl. This function will return the list for the attribute.
								 As a default, this is [], but a list can also be passed in"""
								if items==None:
									items=[]		
								if self.__vals__[key]==None:
									self.__vals__[key]=items
								else:
									raise RuntimeError("This attribute has been already initialised")	
								return self.__vals__[key]
							return make_attribute
						#Add the function to this class
						d[key]=func_factory(key)
					
					d["__vals__"]=__vals__
					#Construct a named tuple from this
					self.__attr__=type('attr_cl',(), d)()
The attributes for the virtual container
recipes/Python/577092_Virtual_collections/recipe-577092.py