From http://rosettacode.org/wiki/Add_a_variable_to_a_class_instance_at_runtime#Python