diff -r 26200f535296 Doc/library/json.rst --- a/Doc/library/json.rst Wed Oct 03 13:53:28 2012 +0530 +++ b/Doc/library/json.rst Thu Oct 04 11:09:59 2012 +0530 @@ -82,6 +82,7 @@ ... def default(self, obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] + ... # Raises a TypeError by calling JSONEncoder.default ... return json.JSONEncoder.default(self, obj) ... >>> json.dumps(2 + 1j, cls=ComplexEncoder) @@ -409,6 +410,7 @@ pass else: return list(iterable) + # Raises a TypeError by calling JSONEncoder.default return json.JSONEncoder.default(self, o) diff -r 26200f535296 Lib/json/encoder.py --- a/Lib/json/encoder.py Wed Oct 03 13:53:28 2012 +0530 +++ b/Lib/json/encoder.py Thu Oct 04 11:09:59 2012 +0530 @@ -163,6 +163,7 @@ pass else: return list(iterable) + # Raises a TypeError by calling JSONEncoder.default return JSONEncoder.default(self, o) """