Message171541
| Author |
Justin.Lebar |
| Recipients |
Justin.Lebar, docs@python, ezio.melotti, kushal.das, petri.lehtinen |
| Date |
2012年09月28日.20:23:01 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1348863782.0.0.180493370899.issue16057@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Ah, I see. The examples do what you think they should do, but not for the reason you think they should do it -- the JSON encoding logic calls the encoder's encode() method before calling its default() method.
I still think the examples could be improved, perhaps by adding a comment to the effect of
# Raises a TypeError.
before the call to JSONEncoder.default(). Explicit is better than implicit, after all. :)
Thanks for looking at this. |
|