annotate docs/rendered/pymonkey.html @ 56:72e84bd75905

Made another doctest easier to read.
author Atul Varma <varmaa@toolness.com>
date Fri, 10 Jul 2009 17:39:48 -0700
parents 40a404b9c467
children a2b617731398
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
51
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
3
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
4 <html xmlns="http://www.w3.org/1999/xhtml">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
5 <head>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
7
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
8 <title>pymonkey — Access SpiderMonkey from Python &mdash; Pymonkey v0.0.1 documentation</title>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
9 <link rel="stylesheet" href="_static/default.css" type="text/css" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
10 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
11 <script type="text/javascript">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
12 var DOCUMENTATION_OPTIONS = {
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
13 URL_ROOT: '',
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
14 VERSION: '0.0.1',
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
15 COLLAPSE_MODINDEX: false,
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
16 FILE_SUFFIX: '.html',
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
17 HAS_SOURCE: true
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
18 };
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
19 </script>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
20 <script type="text/javascript" src="_static/jquery.js"></script>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
21 <script type="text/javascript" src="_static/doctools.js"></script>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
22 <link rel="top" title="Pymonkey v0.0.1 documentation" href="index.html" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
23 <link rel="prev" title="Pymonkey Documentation" href="index.html" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
24 </head>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
25 <body>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
26 <div class="related">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
27 <h3>Navigation</h3>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
28 <ul>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
29 <li class="right" style="margin-right: 10px">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
30 <a href="genindex.html" title="General Index"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
31 accesskey="I">index</a></li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
32 <li class="right" >
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
33 <a href="modindex.html" title="Global Module Index"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
34 accesskey="M">modules</a> |</li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
35 <li class="right" >
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
36 <a href="index.html" title="Pymonkey Documentation"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
37 accesskey="P">previous</a> |</li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
38 <li><a href="index.html">Pymonkey v0.0.1 documentation</a> &raquo;</li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
39 </ul>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
40 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
41
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
42 <div class="document">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
43 <div class="documentwrapper">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
44 <div class="bodywrapper">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
45 <div class="body">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
46
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
47 <div class="section" id="module-pymonkey">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
48 <h1><tt class="xref docutils literal"><span class="pre">pymonkey</span></tt> &#8212; Access SpiderMonkey from Python<a class="headerlink" href="#module-pymonkey" title="Permalink to this headline">¶</a></h1>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
49 <p>This module offers a low-level interface to the <a class="reference" href="https://developer.mozilla.org/en/SpiderMonkey">Mozilla SpiderMonkey</a> JavaScript engine.</p>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
50 <dl class="exception">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
51 <dt id="pymonkey.error">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
52 <em class="property">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
53 exception </em><tt class="descclassname">pymonkey.</tt><tt class="descname">error</tt><a class="headerlink" href="#pymonkey.error" title="Permalink to this definition">¶</a></dt>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
54 <dd>This is the type of any SpiderMonkey-related errors thrown by this
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
55 module.</dd></dl>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
56
54
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
57 <dl class="data">
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
58 <dt id="pymonkey.undefined">
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
59 <tt class="descclassname">pymonkey.</tt><tt class="descname">undefined</tt><a class="headerlink" href="#pymonkey.undefined" title="Permalink to this definition">¶</a></dt>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
60 <dd><p>This is the singleton that represents the JavaScript value
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
61 <tt class="docutils literal"><span class="pre">undefined</span></tt>, as Python has no equivalent representation
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
62 (JavaScript&#8217;s <tt class="docutils literal"><span class="pre">null</span></tt> is mapped to Python&#8217;s <tt class="xref docutils literal"><span class="pre">None</span></tt> object).
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
63 For instance:</p>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
64 <div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cx</span> <span class="o">=</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Runtime</span><span class="p">()</span><span class="o">.</span><span class="n">new_context</span><span class="p">()</span>
56
72e84bd75905 Made another doctest easier to read.
Atul Varma <varmaa@toolness.com>
parents: 55
diff changeset
65 <span class="gp">&gt;&gt;&gt; </span><span class="n">cx</span><span class="o">.</span><span class="n">evaluate_script</span><span class="p">(</span><span class="n">cx</span><span class="o">.</span><span class="n">new_object</span><span class="p">(),</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="s">&#39;&lt;string&gt;&#39;</span><span class="p">,</span> <span class="mf">1</span><span class="p">)</span>
54
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
66 <span class="go">&lt;type &#39;pymonkey.undefined&#39;&gt;</span>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
67 </pre></div>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
68 </div>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
69 <p>Unfortunately, this object currently does not have a &#8220;falsy&#8221; value,
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
70 e.g.:</p>
55
40a404b9c467 Made a doctest more readable.
Atul Varma <varmaa@toolness.com>
parents: 54
diff changeset
71 <div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">if</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">undefined</span><span class="p">:</span>
54
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
72 <span class="gp">... </span> <span class="k">print</span> <span class="s">&#39;Huh, this is kind of unintuitive.&#39;</span>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
73 <span class="go">Huh, this is kind of unintuitive.</span>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
74 </pre></div>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
75 </div>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
76 <p>The reason for this is simply that we don&#8217;t currently know how to
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
77 make this object have a falsy value, if it&#8217;s even possible.</p>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
78 </dd></dl>
234fca1c4b86 Added docs for pymonkey.undefined.
Atul Varma <varmaa@toolness.com>
parents: 53
diff changeset
79
51
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
80 <dl class="class">
53
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
81 <dt id="pymonkey.Object">
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
82 <em class="property">
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
83 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Object</tt><a class="headerlink" href="#pymonkey.Object" title="Permalink to this definition">¶</a></dt>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
84 <dd><p>This is the type of JavaScript objects. Such objects can only be
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
85 created via Pymonkey calls like <tt class="xref docutils literal"><span class="pre">Context.new_object()</span></tt> or
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
86 through the execution of JS code, but this type object can be used
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
87 with Python&#8217;s built-in <tt class="xref docutils literal"><span class="pre">isinstance()</span></tt> to verify that an
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
88 object is a JS object, like so:</p>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
89 <div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">obj</span> <span class="o">=</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Runtime</span><span class="p">()</span><span class="o">.</span><span class="n">new_context</span><span class="p">()</span><span class="o">.</span><span class="n">new_object</span><span class="p">()</span>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
90 <span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Object</span><span class="p">)</span>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
91 <span class="go">True</span>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
92 </pre></div>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
93 </div>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
94 </dd></dl>
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
95
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
96 <dl class="class">
51
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
97 <dt id="pymonkey.Context">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
98 <em class="property">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
99 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Context</tt><a class="headerlink" href="#pymonkey.Context" title="Permalink to this definition">¶</a></dt>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
100 <dd><p>This is the type of JavaScript context objects. Contexts can only
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
101 be created via a call to <a title="pymonkey.Runtime.new_context" class="reference" href="#pymonkey.Runtime.new_context"><tt class="xref docutils literal"><span class="pre">Runtime.new_context()</span></tt></a>, but this
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
102 type object can be used with Python&#8217;s built-in <tt class="xref docutils literal"><span class="pre">isinstance()</span></tt>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
103 to verify that an object is a context, like so:</p>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
104 <div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cx</span> <span class="o">=</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Runtime</span><span class="p">()</span><span class="o">.</span><span class="n">new_context</span><span class="p">()</span>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
105 <span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span> <span class="n">pymonkey</span><span class="o">.</span><span class="n">Context</span><span class="p">)</span>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
106 <span class="go">True</span>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
107 </pre></div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
108 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
109 </dd></dl>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
110
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
111 <dl class="class">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
112 <dt id="pymonkey.Runtime">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
113 <em class="property">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
114 class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Runtime</tt><a class="headerlink" href="#pymonkey.Runtime" title="Permalink to this definition">¶</a></dt>
53
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
115 <dd><p>Creates a new JavaScript runtime. JS objects created by the runtime
2055d853b995 Added docs for pymonkey.Object.
Atul Varma <varmaa@toolness.com>
parents: 51
diff changeset
116 may only interact with other JS objects of the same runtime.</p>
51
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
117 <dl class="method">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
118 <dt id="pymonkey.Runtime.new_context">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
119 <tt class="descname">new_context</tt><big>(</big><big>)</big><a class="headerlink" href="#pymonkey.Runtime.new_context" title="Permalink to this definition">¶</a></dt>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
120 <dd>Creates a new Context object and returns it. Contexts are best
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
121 conceptualized as threads of execution in a JS runtme; each one
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
122 has a program counter, a current exception state, and so
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
123 forth. JS objects may be freely accessed and changed by contexts
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
124 that are associated with the same JS runtime as the objects.</dd></dl>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
125
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
126 </dd></dl>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
127
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
128 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
129
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
130
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
131 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
132 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
133 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
134 <div class="sphinxsidebar">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
135 <div class="sphinxsidebarwrapper">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
136 <h4>Previous topic</h4>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
137 <p class="topless"><a href="index.html"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
138 title="previous chapter">Pymonkey Documentation</a></p>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
139 <h3>This Page</h3>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
140 <ul class="this-page-menu">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
141 <li><a href="_sources/pymonkey.txt"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
142 rel="nofollow">Show Source</a></li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
143 </ul>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
144 <div id="searchbox" style="display: none">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
145 <h3>Quick search</h3>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
146 <form class="search" action="search.html" method="get">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
147 <input type="text" name="q" size="18" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
148 <input type="submit" value="Go" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
149 <input type="hidden" name="check_keywords" value="yes" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
150 <input type="hidden" name="area" value="default" />
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
151 </form>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
152 <p class="searchtip" style="font-size: 90%">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
153 Enter search terms or a module, class or function name.
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
154 </p>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
155 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
156 <script type="text/javascript">$('#searchbox').show(0);</script>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
157 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
158 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
159 <div class="clearer"></div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
160 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
161 <div class="related">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
162 <h3>Navigation</h3>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
163 <ul>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
164 <li class="right" style="margin-right: 10px">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
165 <a href="genindex.html" title="General Index"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
166 >index</a></li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
167 <li class="right" >
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
168 <a href="modindex.html" title="Global Module Index"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
169 >modules</a> |</li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
170 <li class="right" >
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
171 <a href="index.html" title="Pymonkey Documentation"
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
172 >previous</a> |</li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
173 <li><a href="index.html">Pymonkey v0.0.1 documentation</a> &raquo;</li>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
174 </ul>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
175 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
176 <div class="footer">
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
177 &copy; Copyright 2009, Atul Varma.
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
178 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.2.
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
179 </div>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
180 </body>
fabd3f2271fa Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
181 </html>