diff options
Diffstat (limited to 'docs/class-simplejson.JSONEncoder.html')
| -rw-r--r-- | docs/class-simplejson.JSONEncoder.html | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/docs/class-simplejson.JSONEncoder.html b/docs/class-simplejson.JSONEncoder.html new file mode 100644 index 0000000..f5d99ce --- /dev/null +++ b/docs/class-simplejson.JSONEncoder.html @@ -0,0 +1,199 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<HTML> + + <HEAD><META CONTENT="text/html; charset=utf-8" HTTP-EQUIV="Content-Type"> + <TITLE>simplejson.JSONEncoder -- Extensible JSON &lt;<a class="reference" href="http://json.org">http://json.org</a>&gt; encoder for Python data structures.</TITLE> + <LINK HREF="layout.css" TYPE="text/css" REL="stylesheet"> + + </HEAD> + <BODY> + <DIV ID="page"> + + <DIV ID="top-nav"> + <H1 ID="doc-title"> + <A HREF="index.html" REL="index">simplejson 1.1</A></H1> + <DIV CLASS="online-navigation"> + <A HREF="index.html" REL="index">index</A> + <SPAN ID="nav-docs"> + + </SPAN> + + + <BR> + + + + <A HREF="module-simplejson.html" TITLE="simplejson reference"> + simplejson + </A> + + + <A HREF="class-simplejson.JSONEncoder.html">details</A> + + <A HREF="class-simplejson.JSONEncoder-index.html"> + tree + </A> + + + </DIV> + </DIV> + + <DIV ID="main-content"> + + <H1 CLASS="pudge-member-page-heading"> + <TT>JSONEncoder</TT> + </H1> + <H4 CLASS="pudge-member-page-subheading"> + Extensible JSON <<A HREF="http://json.org" CLASS="reference">http://json.org</A>> encoder for Python data structures. + </H4> + <P CLASS="pudge-member-parent-link"> + <SMALL> + The JSONEncoder class is accessible via the + <A HREF="module-simplejson.html"> + <TT>simplejson</TT> + </A> module. + </SMALL> + </P> + <DIV ID="pudge-section-nav"> + <UL> + <LI> + + <SPAN CLASS="pudge-missing-section-link"> + Attributes + </SPAN> + </LI> + <LI> + <A HREF="#methods" CLASS="pudge-section-link"> + Methods (1) + </A> + + </LI> + + <LI> + <A HREF="simplejson/encoder.py.html?f=63&l=273#63" CLASS="pudge-section-link"> + Source + </A> + </LI> + </UL> + </DIV> + <DIV STYLE="clear: left"> + </DIV> + <DIV CLASS="rst pudge-module-doc"> + <P>Supports the following objects and types by default:</P> +<TABLE BORDER="1" CLASS="docutils"> +<COLGROUP> +<COL WIDTH="56%"> + +<COL WIDTH="44%"> + +</COLGROUP> +<THEAD VALIGN="bottom"> +<TR> +<TH CLASS="head">Python</TH> +<TH CLASS="head">JSON</TH> +</TR> +</THEAD> +<TBODY VALIGN="top"> +<TR> +<TD>dict</TD> +<TD>object</TD> +</TR> +<TR> +<TD>list, tuple</TD> +<TD>array</TD> +</TR> +<TR> +<TD>str, unicode</TD> +<TD>string</TD> +</TR> +<TR> +<TD>int, long, float</TD> +<TD>number</TD> +</TR> +<TR> +<TD>True</TD> +<TD>true</TD> +</TR> +<TR> +<TD>False</TD> +<TD>false</TD> +</TR> +<TR> +<TD>None</TD> +<TD>null</TD> +</TR> +</TBODY> +</TABLE> +<P>To extend this to recognize other objects, subclass and implement a +<TT CLASS="docutils literal"><SPAN CLASS="pre">.default(o)</SPAN></TT> method with another method that returns a serializable +object for <TT CLASS="docutils literal"><SPAN CLASS="pre">o</SPAN></TT> if possible, otherwise it should call the superclass +implementation (to raise <TT CLASS="docutils literal"><SPAN CLASS="pre">TypeError</SPAN></TT>).</P> + </DIV> + + <HR> + + + + + <A NAME="methods"> + + + </A> + <H2>Methods</H2> + <DIV CLASS="pudge-member routine alias"> + <A NAME="__init__"> + </A> + <H4 CLASS="pudge-member-name"> + <SPAN CLASS="prefix">f</SPAN> + <TT> + <A HREF="class-simplejson.JSONEncoder.html#__init__" CLASS="pudge-obj-link">__init__</A>(self, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True)</TT> + <A HREF="simplejson/encoder.py.html?f=92&l=120#92" TITLE="View Source">...</A> + </H4> + <DIV CLASS="pudge-section rst"> + + <P CLASS="pudge-member-blurb"> + Constructor for JSONEncoder, with sensible defaults. + </P> + <P>If skipkeys is False, then it is a TypeError to attempt +encoding of keys that are not str, int, long, float or None. If +skipkeys is True, such items are simply skipped.</P> +<P>If ensure_ascii is True, the output is guaranteed to be str +objects with all incoming unicode characters escaped. If ensure_ascii +is false, the output will be unicode object.</P> +<P>If check_circular is True, then lists, dicts, and custom encoded +objects will be checked for circular references during encoding to +prevent an infinite recursion (which would cause an OverflowError). +Otherwise, no such check takes place.</P> +<P>If allow_nan is True, then NaN, Infinity, and -Infinity will be +encoded as such. This behavior is not JSON specification compliant, +but is consistent with most JavaScript based encoders and decoders. +Otherwise, it will be a ValueError to encode such floats.</P> + + </DIV> + </DIV> + + + + <P> + <SMALL> + + + See + <A HREF="simplejson/encoder.py.html?f=63&l=273#63" TITLE="simplejson/encoder.py:63">the source</A> + for more information. + </SMALL> + </P> +</DIV> + + <DIV ID="footer"> + + <P ID="pudge"> + Built with + <A HREF="http://lesscode.org/projects/pudge/"> + Pudge/0.1</A> + </P> + + </DIV> + </DIV> + </BODY> +</HTML>
\ No newline at end of file |
