If skipkeys is True then dict keys that are not basic types
(str, unicode, int, long, float, bool, None)
will be skipped instead of raising a TypeError.

If ensure_ascii is False, then the some chunks written to fp
may be unicode instances, subject to normal Python str to
unicode coercion rules. Unless fp.write() explicitly
understands unicode (as in codecs.getwriter()) this is likely
to cause an error.

If check_circular is False, then the circular reference check
for container types will be skipped and a circular reference will
result in an OverflowError (or worse).

If allow_nan is False, then it will be a ValueError to
serialize out of range float values (nan, inf, -inf)
in strict compliance of the JSON specification, instead of using the
JavaScript equivalents (NaN, Infinity, -Infinity).

If indent is a non-negative integer, then JSON array elements and object
members will be pretty-printed with that indent level. An indent level
of 0 will only insert newlines. None is the most compact representation.

encoding is the character encoding for str instances, default is UTF-8.

To use a custom JSONEncoder subclass (e.g. one that overrides the
.default() method to serialize additional types), specify it with
the cls kwarg.

If skipkeys is True then dict keys that are not basic types
(str, unicode, int, long, float, bool, None)
will be skipped instead of raising a TypeError.

If ensure_ascii is False, then the return value will be a
unicode instance subject to normal Python str to unicode
coercion rules instead of being escaped to an ASCII str.

If check_circular is False, then the circular reference check
for container types will be skipped and a circular reference will
result in an OverflowError (or worse).

If allow_nan is False, then it will be a ValueError to
serialize out of range float values (nan, inf, -inf) in
strict compliance of the JSON specification, instead of using the
JavaScript equivalents (NaN, Infinity, -Infinity).

If indent is a non-negative integer, then JSON array elements and
object members will be pretty-printed with that indent level. An indent
level of 0 will only insert newlines. None is the most compact
representation.

If separators is an (item_separator,dict_separator) tuple
then it will be used instead of the default (',',':') separators.
(',',':') is the most compact JSON representation.

encoding is the character encoding for str instances, default is UTF-8.

To use a custom JSONEncoder subclass (e.g. one that overrides the
.default() method to serialize additional types), specify it with
the cls kwarg.

If the contents of fp is encoded with an ASCII based encoding other
than utf-8 (e.g. latin-1), then an appropriate encoding name must
be specified. Encodings that are not ASCII based (such as UCS-2) are
not allowed, and should be wrapped with
codecs.getreader(fp)(encoding), or simply decoded to a unicode
object and passed to loads()

object_hook is an optional function that will be called with the
result of any object literal decode (a dict). The return value of
object_hook will be used instead of the dict. This feature
can be used to implement custom decoders (e.g. JSON-RPC class hinting).

If s is a str instance and is encoded with an ASCII based encoding
other than utf-8 (e.g. latin-1) then an appropriate encoding name
must be specified. Encodings that are not ASCII based (such as UCS-2)
are not allowed and should be decoded to unicode first.

object_hook is an optional function that will be called with the
result of any object literal decode (a dict). The return value of
object_hook will be used instead of the dict. This feature
can be used to implement custom decoders (e.g. JSON-RPC class hinting).

To extend this to recognize other objects, subclass and implement a
.default() method with another method that returns a serializable
object for o if possible, otherwise it should call the superclass
implementation (to raise TypeError).