Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #13200 > unrolled thread
| Started by | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| First post | 2011-09-12 17:04 -0400 |
| Last post | 2011-09-12 17:04 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: What do you guys think about adding a method "to_json" Terry Reedy <tjreedy@udel.edu> - 2011-09-12 17:04 -0400
| From | Terry Reedy <tjreedy@udel.edu> |
|---|---|
| Date | 2011-09-12 17:04 -0400 |
| Subject | Re: What do you guys think about adding a method "to_json" |
| Message-ID | <mailman.1049.1315861509.27778.python-list@python.org> |
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
Back to top | Article view | comp.lang.python
csiph-web