On 9/12/2011 12:34 AM, Juan Pablo Romero Méndez wrote:
Hello,

What do you guys think about adding a method "to_json" to dictionaries
and sequence types? Perhaps through a module import?

Negative. If this were added, why not to_yaml, to_marshal, to_pickle, to_zip, and so on. Better to have each storage or transfer class handle its own instance creation. The one to_x method that every class should have is to_string, which is spelled __str__ and inherited from object.

--
Terry Jan Reedy


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to