changeset 85:e9f450d30c0e

Added more documentation.
author Atul Varma <varmaa@toolness.com>
date Sun, 09 Aug 2009 15:37:29 -0700
parents 10205d88f6ff
children 16a3e99e9b77
files docs/rendered/_sources/index.txt docs/rendered/_sources/pymonkey.txt docs/rendered/genindex.html docs/rendered/index.html docs/rendered/pymonkey.html docs/rendered/searchindex.js docs/src/index.txt docs/src/pymonkey.txt
diffstat 8 files changed, 116 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/docs/rendered/_sources/index.txt	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/rendered/_sources/index.txt	Sun Aug 09 15:37:29 2009 -0700
@@ -96,14 +96,17 @@
 **Garbage Collection**
 
 Python's garbage collection uses reference counting, whereas
-SpiderMonkey's is mark-and-sweep. We'll likely run into situations
-where there are cycles that exist between SpiderMonkey and Python
-objects; this is actually quite similar to the relationship between
-XPCOM and JavaScript in the Mozilla platform--XPCOM uses reference
-counting too--so detecting such cycles will probably involve creating
-something akin to `XPCOM's cycle collector
+SpiderMonkey's is mark-and-sweep. It's possible for there to be
+situations where there are cycles that exist between SpiderMonkey and
+Python objects; this is actually quite similar to the relationship
+between XPCOM and JavaScript in the Mozilla platform--XPCOM uses
+reference counting too--so detecting such cycles will probably involve
+creating something akin to `XPCOM's cycle collector
 <https://developer.mozilla.org/en/Interfacing_with_the_XPCOM_cycle_collector>`_.
 
+For the time being, however, such cycles can be manually broken via
+:meth:`pymonkey.Context.clear_object_private()` on valid objects and functions.
+
 Indices and Tables
 ==================
 
--- a/docs/rendered/_sources/pymonkey.txt	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/rendered/_sources/pymonkey.txt	Sun Aug 09 15:37:29 2009 -0700
@@ -49,6 +49,11 @@
 
       Returns the :class:`Runtime` that the object belongs to.
 
+.. class:: Function
+
+   This is the type of JavaScript functions, which is a subtype of
+   :class:`Object`.
+
 .. class:: Context
 
    This is the type of JavaScript context objects. Contexts can only
@@ -71,15 +76,35 @@
       stored within the new JS object; it can be retrieved using
       :meth:`get_object_private()`.
 
+   .. method:: new_function(callable, name)
+
+      Creates a new :class:`Function` instance that wraps the
+      given Python callable.  In JS-land, the callable will
+      have the given name.
+
    .. method:: get_object_private(object)
 
       Returns the ``private_obj`` passed to :meth:`new_object()`
       when `object` was first created. If it doesn't exist, ``None``
       is returned.
 
+      If `object` was created with :meth:`new_function()`, then this
+      method returns the Python callable wrapped by `object`.
+
       This functionality is useful if you want to represent Python
       objects in JS-land.
 
+   .. method:: clear_object_private(object)
+
+      Clears the ``private_obj`` passed to :meth:`new_object()`
+      when `object` was first created. If it doesn't exist, this
+      function returns nothing.
+
+      If `object` was created with :meth:`new_function()`, then this
+      method effectively "unbinds" the Python callable wrapped by
+      `object`. If `object` is later called, an exception will be
+      raised.
+
    .. method:: init_standard_classes(object)
 
       Defines the standard JavaScript classes on the given
--- a/docs/rendered/genindex.html	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/rendered/genindex.html	Sun Aug 09 15:37:29 2009 -0700
@@ -43,7 +43,7 @@
 
    <h1 id="index">Index</h1>
 
-   <a href="#C"><strong>C</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#O"><strong>O</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#U"><strong>U</strong></a> 
+   <a href="#C"><strong>C</strong></a> | <a href="#E"><strong>E</strong></a> | <a href="#F"><strong>F</strong></a> | <a href="#G"><strong>G</strong></a> | <a href="#I"><strong>I</strong></a> | <a href="#N"><strong>N</strong></a> | <a href="#O"><strong>O</strong></a> | <a href="#P"><strong>P</strong></a> | <a href="#R"><strong>R</strong></a> | <a href="#U"><strong>U</strong></a> 
 
    <hr />
 
@@ -52,6 +52,7 @@
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
 
+<dt><a href="pymonkey.html#pymonkey.Context.clear_object_private">clear_object_private() (pymonkey.Context method)</a></dt>
 <dt><a href="pymonkey.html#pymonkey.Context">Context (class in pymonkey)</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
@@ -62,6 +63,13 @@
 <dt><a href="pymonkey.html#pymonkey.error">error</a></dt></dl></td><td width="33%" valign="top"><dl>
 </dl></td></tr></table>
 
+<h2 id="F">F</h2>
+<table width="100%" class="indextable"><tr><td width="33%" valign="top">
+<dl>
+
+<dt><a href="pymonkey.html#pymonkey.Function">Function (class in pymonkey)</a></dt></dl></td><td width="33%" valign="top"><dl>
+</dl></td></tr></table>
+
 <h2 id="G">G</h2>
 <table width="100%" class="indextable"><tr><td width="33%" valign="top">
 <dl>
@@ -85,7 +93,8 @@
 <dl>
 
 <dt><a href="pymonkey.html#pymonkey.Runtime.new_context">new_context() (pymonkey.Runtime method)</a></dt>
-<dt><a href="pymonkey.html#pymonkey.Context.new_object">new_object() (pymonkey.Context method)</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="pymonkey.html#pymonkey.Context.new_function">new_function() (pymonkey.Context method)</a></dt></dl></td><td width="33%" valign="top"><dl>
+<dt><a href="pymonkey.html#pymonkey.Context.new_object">new_object() (pymonkey.Context method)</a></dt>
 </dl></td></tr></table>
 
 <h2 id="O">O</h2>
--- a/docs/rendered/index.html	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/rendered/index.html	Sun Aug 09 15:37:29 2009 -0700
@@ -123,12 +123,14 @@
 pymonkey can be really usable. Here&#8217;s some of them.</p>
 <p><strong>Garbage Collection</strong></p>
 <p>Python&#8217;s garbage collection uses reference counting, whereas
-SpiderMonkey&#8217;s is mark-and-sweep. We&#8217;ll likely run into situations
-where there are cycles that exist between SpiderMonkey and Python
-objects; this is actually quite similar to the relationship between
-XPCOM and JavaScript in the Mozilla platform&#8211;XPCOM uses reference
-counting too&#8211;so detecting such cycles will probably involve creating
-something akin to <a class="reference" href="https://developer.mozilla.org/en/Interfacing_with_the_XPCOM_cycle_collector">XPCOM&#8217;s cycle collector</a>.</p>
+SpiderMonkey&#8217;s is mark-and-sweep. It&#8217;s possible for there to be
+situations where there are cycles that exist between SpiderMonkey and
+Python objects; this is actually quite similar to the relationship
+between XPCOM and JavaScript in the Mozilla platform&#8211;XPCOM uses
+reference counting too&#8211;so detecting such cycles will probably involve
+creating something akin to <a class="reference" href="https://developer.mozilla.org/en/Interfacing_with_the_XPCOM_cycle_collector">XPCOM&#8217;s cycle collector</a>.</p>
+<p>For the time being, however, such cycles can be manually broken via
+<a title="pymonkey.Context.clear_object_private" class="reference" href="pymonkey.html#pymonkey.Context.clear_object_private"><tt class="xref docutils literal"><span class="pre">pymonkey.Context.clear_object_private()</span></tt></a> on valid objects and functions.</p>
 </div>
 <div class="section" id="indices-and-tables">
 <h2>Indices and Tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h2>
--- a/docs/rendered/pymonkey.html	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/rendered/pymonkey.html	Sun Aug 09 15:37:29 2009 -0700
@@ -96,6 +96,13 @@
 </dd></dl>
 
 <dl class="class">
+<dt id="pymonkey.Function">
+<em class="property">
+class </em><tt class="descclassname">pymonkey.</tt><tt class="descname">Function</tt><a class="headerlink" href="#pymonkey.Function" title="Permalink to this definition">¶</a></dt>
+<dd>This is the type of JavaScript functions, which is a subtype of
+<a title="pymonkey.Object" class="reference" href="#pymonkey.Object"><tt class="xref docutils literal"><span class="pre">Object</span></tt></a>.</dd></dl>
+
+<dl class="class">
 <dt id="pymonkey.Context">
 <em class="property">
 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>
@@ -122,16 +129,37 @@
 <a title="pymonkey.Context.get_object_private" class="reference" href="#pymonkey.Context.get_object_private"><tt class="xref docutils literal"><span class="pre">get_object_private()</span></tt></a>.</dd></dl>
 
 <dl class="method">
+<dt id="pymonkey.Context.new_function">
+<tt class="descname">new_function</tt><big>(</big><em>callable</em>, <em>name</em><big>)</big><a class="headerlink" href="#pymonkey.Context.new_function" title="Permalink to this definition">¶</a></dt>
+<dd>Creates a new <a title="pymonkey.Function" class="reference" href="#pymonkey.Function"><tt class="xref docutils literal"><span class="pre">Function</span></tt></a> instance that wraps the
+given Python callable.  In JS-land, the callable will
+have the given name.</dd></dl>
+
+<dl class="method">
 <dt id="pymonkey.Context.get_object_private">
 <tt class="descname">get_object_private</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#pymonkey.Context.get_object_private" title="Permalink to this definition">¶</a></dt>
 <dd><p>Returns the <tt class="docutils literal"><span class="pre">private_obj</span></tt> passed to <a title="pymonkey.Context.new_object" class="reference" href="#pymonkey.Context.new_object"><tt class="xref docutils literal"><span class="pre">new_object()</span></tt></a>
 when <cite>object</cite> was first created. If it doesn&#8217;t exist, <tt class="xref docutils literal"><span class="pre">None</span></tt>
 is returned.</p>
+<p>If <cite>object</cite> was created with <a title="pymonkey.Context.new_function" class="reference" href="#pymonkey.Context.new_function"><tt class="xref docutils literal"><span class="pre">new_function()</span></tt></a>, then this
+method returns the Python callable wrapped by <cite>object</cite>.</p>
 <p>This functionality is useful if you want to represent Python
 objects in JS-land.</p>
 </dd></dl>
 
 <dl class="method">
+<dt id="pymonkey.Context.clear_object_private">
+<tt class="descname">clear_object_private</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#pymonkey.Context.clear_object_private" title="Permalink to this definition">¶</a></dt>
+<dd><p>Clears the <tt class="docutils literal"><span class="pre">private_obj</span></tt> passed to <a title="pymonkey.Context.new_object" class="reference" href="#pymonkey.Context.new_object"><tt class="xref docutils literal"><span class="pre">new_object()</span></tt></a>
+when <cite>object</cite> was first created. If it doesn&#8217;t exist, this
+function returns nothing.</p>
+<p>If <cite>object</cite> was created with <a title="pymonkey.Context.new_function" class="reference" href="#pymonkey.Context.new_function"><tt class="xref docutils literal"><span class="pre">new_function()</span></tt></a>, then this
+method effectively &#8220;unbinds&#8221; the Python callable wrapped by
+<cite>object</cite>. If <cite>object</cite> is later called, an exception will be
+raised.</p>
+</dd></dl>
+
+<dl class="method">
 <dt id="pymonkey.Context.init_standard_classes">
 <tt class="descname">init_standard_classes</tt><big>(</big><em>object</em><big>)</big><a class="headerlink" href="#pymonkey.Context.init_standard_classes" title="Permalink to this definition">¶</a></dt>
 <dd>Defines the standard JavaScript classes on the given
--- a/docs/rendered/searchindex.js	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/rendered/searchindex.js	Sun Aug 09 15:37:29 2009 -0700
@@ -1,1 +1,1 @@
-Search.setIndex({desctypes:{"0":"method","1":"exception","2":"class","3":"data"},terms:{spidermonkei:[0,1],represent:1,all:0,code:[0,1],just:0,less:0,path_to_objdir:0,untrust:0,lack:0,becaus:0,intermediari:0,veri:0,concept:0,particularli:0,get_object_priv:1,environ:0,languag:0,involv:0,web:0,onli:[0,1],depend:0,execut:[0,1],expos:0,how:0,readabl:0,except:1,should:0,platform:0,add:[],busi:0,requir:0,easier:0,isinst:1,them:0,js_initstandardclass:1,"return":1,around:0,thei:[],without:0,python:[0,1],swig:0,none:1,pave:0,obtain:0,atul:0,envis:0,capi:0,increas:0,world:0,now:[],vast:0,enabl:0,xpcom:0,like:[0,1],level:1,vibrant:0,get_runtim:1,anyth:0,probabl:0,resolv:0,server:0,"try":0,easili:0,off:0,either:0,each:1,debug:0,through:1,where:0,manag:0,mean:0,right:[],new_context:1,some:0,back:0,realli:0,wrap:1,see:1,"static":0,mirror:0,disadvantag:0,stack:0,collector:0,casual:0,librari:0,out:0,even:[],index:0,detect:0,string:1,collect:0,test_pymonkei:[],someth:0,abl:0,best:1,rhino:0,access:[0,1],state:1,outstand:0,dynam:0,rational:0,between:0,print:1,"new":1,objdir:0,forth:1,method:1,challeng:0,refer:0,docutil:1,full:0,run:0,complex:0,garbag:0,javascript:[0,1],situat:0,new_object:1,here:0,standard:[0,1],objcec:[],extens:0,reason:[],base:0,preprocessor:0,repositori:0,complementari:0,path:0,come:0,don:0,valu:1,thrown:1,search:0,actual:0,easi:0,thread:1,befor:0,similar:0,current:[0,1],http:0,moment:0,page:0,blargh:[],instanc:[0,1],doctest:0,context:1,logic:0,freeli:1,chang:1,com:0,first:1,tremend:0,singleton:1,via:[0,1],simpli:[],eval:1,obviou:0,pyrex:0,feel:[],solut:0,arrai:1,runtm:1,number:0,latter:0,header:0,instruct:0,api:0,serverj:0,contributor:0,side:0,mark:0,facil:0,your:0,duplic:0,quit:0,given:1,doe:[],span:1,advantag:0,wai:0,script:0,ergonom:0,interact:1,init_standard_class:1,due:0,custom:0,avail:0,process:0,program:1,call:1,low:1,lot:0,suit:[],interfac:1,type:1,"final":0,store:1,too:0,free:[],from:[0,1],relationship:0,offer:1,tool:0,mozilla:[0,1],huh:[],about:0,ctype:0,within:1,known:0,central:0,eas:0,repres:1,"true":1,than:0,must:0,count:0,wide:0,kind:[],made:0,retriev:1,possibl:[],provid:0,straight:0,work:0,private_obj:1,conceptu:1,can:[0,1],learn:0,akin:0,modul:[0,1],more:[0,1],root:0,browser:0,pre:1,"function":1,would:0,traceback:0,file:0,creat:[0,1],give:0,falsi:1,unintuit:[],pass:1,readm:0,ani:[0,1],doesn:[0,1],trap:0,blah:[],liter:1,exist:[0,1],have:0,tabl:0,need:0,unfortun:[],featur:0,check:[],contribut:0,packag:0,alwai:0,sweep:0,"null":1,engin:[0,1],goal:0,want:[0,1],secur:0,boop:[],parti:0,make:0,belong:1,when:1,cross:0,same:1,client:0,note:0,field:0,ideal:0,other:[0,1],read:0,build:0,which:[0,1],test:0,verifi:1,you:[0,1],document:[0,1],noth:0,boof:[],runtim:1,map:1,product:0,relat:1,matur:0,privat:1,clone:0,object:[0,1],wherea:0,usabl:0,hand:0,fairli:0,plai:0,never:0,mai:1,develop:0,defin:[0,1],associ:1,"class":1,pymonkei:[0,1],built:1,directori:0,memori:0,todo:[],land:[0,1],sphinx:0,equival:1,third:0,java:0,also:[0,1],macro:0,cycl:0,counter:1,error:1,inform:1,sandbox:0,exampl:[],write:0,obj:1,thi:[0,1],indic:0,undefin:1,programm:0,model:0,profil:0,evaluate_script:1,awesom:0,know:[]},titles:["Pymonkey Documentation","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pymonkey</span></tt> &#8212; Access SpiderMonkey from Python"],modules:{pymonkey:1},descrefs:{"pymonkey.Runtime":{new_context:[1,0]},"pymonkey.Object":{get_runtime:[1,0]},"pymonkey.Context":{get_object_private:[1,0],new_object:[1,0],init_standard_classes:[1,0],get_runtime:[1,0]},pymonkey:{Object:[1,2],Runtime:[1,2],undefined:[1,3],Context:[1,2],error:[1,1]}},filenames:["index","pymonkey"]})
\ No newline at end of file
+Search.setIndex({desctypes:{"0":"method","1":"exception","2":"class","3":"data"},terms:{spidermonkei:[0,1],represent:1,all:0,code:[0,1],untrust:0,lack:0,concept:0,get_object_priv:1,privat:1,depend:0,readabl:0,program:1,isinst:1,liter:1,string:1,veri:0,vast:0,level:1,"try":0,pass:1,casual:0,even:[],index:0,evaluate_script:1,abl:0,access:[0,1],"new":1,objdir:0,method:1,full:0,never:0,onli:[0,1],here:0,objcec:[],path:0,valu:1,search:0,doctest:0,chang:1,tremend:0,via:[0,1],modul:[0,1],api:0,test_pymonkei:[],from:[0,1],would:0,memori:0,init_standard_class:1,call:1,type:1,more:[0,1],mozilla:[0,1],ctype:0,known:0,central:0,must:0,none:1,retriev:1,work:0,conceptu:1,can:[0,1],learn:0,akin:0,root:0,give:0,process:0,challeng:0,indic:0,want:[0,1],unfortun:[],alwai:0,goal:0,secur:0,write:0,how:0,verifi:1,map:1,product:0,clone:0,usabl:0,befor:0,mai:1,associ:1,third:0,counter:1,inform:1,sandbox:0,environ:0,subtyp:1,callabl:1,becaus:0,intermediari:0,through:1,dynam:0,platform:0,easier:0,them:0,js_initstandardclass:1,"return":1,thei:[],python:[0,1],now:[],xpcom:0,name:1,anyth:0,get_runtim:1,easili:0,trap:0,each:1,debug:0,side:0,mean:0,realli:0,wrap:1,"static":0,collector:0,out:0,path_to_objdir:0,profil:0,rational:0,print:1,forth:1,situat:0,free:[],standard:[0,1],reason:[],base:0,thrown:1,thread:1,traceback:0,first:1,singleton:1,obviou:0,pyrex:0,feel:[],arrai:1,number:0,instruct:0,facil:0,given:1,script:0,interact:1,too:0,"final":0,store:1,relationship:0,tool:0,huh:[],than:0,wide:0,kind:[],provid:0,browser:0,pre:1,falsi:1,ani:[0,1],packag:0,have:[0,1],tabl:0,need:0,"null":1,engin:[0,1],built:1,equival:1,latter:0,client:0,note:0,also:[0,1],ideal:0,exampl:[],build:0,which:[0,1],noth:[0,1],object:[0,1],plai:0,"class":1,don:0,clear:1,later:1,doe:[],runtim:1,awesom:0,particularli:0,involv:0,current:[0,1],new_object:1,execut:[0,1],solut:0,should:0,busi:0,contribut:0,pave:0,increas:0,requir:0,enabl:0,where:0,new_context:1,see:1,disadvantag:0,best:1,detect:0,someth:0,state:1,outstand:0,between:0,atul:0,javascript:[0,1],extens:0,preprocessor:0,complementari:0,come:0,expos:0,cycl:0,howev:0,blargh:[],instanc:[0,1],context:[0,1],logic:0,freeli:1,com:0,private_obj:1,simpli:[],within:1,sweep:0,header:0,duplic:0,quit:0,java:0,due:0,mark:0,clear_object_priv:[0,1],straight:0,defin:[0,1],error:1,advantag:0,unintuit:[],readm:0,blah:[],develop:0,parti:0,make:0,belong:1,cross:0,same:1,complex:0,document:[0,1],http:0,wherea:0,effect:1,hand:0,fairli:0,moment:0,rais:1,stack:0,pymonkei:[0,1],off:0,macro:0,without:0,thi:[0,1],undefin:1,programm:0,model:0,capi:0,new_funct:1,just:0,less:0,obtain:0,languag:0,web:0,easi:0,except:1,add:[],other:[0,1],around:0,read:0,swig:0,envis:0,know:[],world:0,like:[0,1],vibrant:0,manual:0,resolv:0,server:0,collect:0,either:0,docutil:1,page:0,right:[],some:0,back:0,mirror:0,librari:0,rhino:0,refer:0,run:0,garbag:0,broken:0,repositori:0,about:0,actual:0,manag:0,runtm:1,serverj:0,contributor:0,your:0,span:1,wai:0,ergonom:0,custom:0,avail:0,interfac:1,low:1,lot:0,suit:[],"function":[0,1],offer:1,eas:0,"true":1,count:0,made:0,possibl:0,similar:0,featur:0,creat:[0,1],doesn:[0,1],repres:1,exist:[0,1],file:0,check:[],probabl:0,boop:[],todo:[],when:1,field:0,valid:0,test:0,you:[0,1],boof:[],matur:0,relat:1,eval:1,unbind:1,land:[0,1],sphinx:0,directori:0,obj:1,time:0},titles:["Pymonkey Documentation","<tt class=\"docutils literal docutils literal\"><span class=\"pre\">pymonkey</span></tt> &#8212; Access SpiderMonkey from Python"],modules:{pymonkey:1},descrefs:{"pymonkey.Runtime":{new_context:[1,0]},"pymonkey.Object":{get_runtime:[1,0]},"pymonkey.Context":{get_object_private:[1,0],new_object:[1,0],clear_object_private:[1,0],new_function:[1,0],init_standard_classes:[1,0],get_runtime:[1,0]},pymonkey:{Function:[1,2],undefined:[1,3],Object:[1,2],Context:[1,2],error:[1,1],Runtime:[1,2]}},filenames:["index","pymonkey"]})
\ No newline at end of file
--- a/docs/src/index.txt	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/src/index.txt	Sun Aug 09 15:37:29 2009 -0700
@@ -96,14 +96,17 @@
 **Garbage Collection**
 
 Python's garbage collection uses reference counting, whereas
-SpiderMonkey's is mark-and-sweep. We'll likely run into situations
-where there are cycles that exist between SpiderMonkey and Python
-objects; this is actually quite similar to the relationship between
-XPCOM and JavaScript in the Mozilla platform--XPCOM uses reference
-counting too--so detecting such cycles will probably involve creating
-something akin to `XPCOM's cycle collector
+SpiderMonkey's is mark-and-sweep. It's possible for there to be
+situations where there are cycles that exist between SpiderMonkey and
+Python objects; this is actually quite similar to the relationship
+between XPCOM and JavaScript in the Mozilla platform--XPCOM uses
+reference counting too--so detecting such cycles will probably involve
+creating something akin to `XPCOM's cycle collector
 <https://developer.mozilla.org/en/Interfacing_with_the_XPCOM_cycle_collector>`_.
 
+For the time being, however, such cycles can be manually broken via
+:meth:`pymonkey.Context.clear_object_private()` on valid objects and functions.
+
 Indices and Tables
 ==================
 
--- a/docs/src/pymonkey.txt	Sun Aug 09 15:18:33 2009 -0700
+++ b/docs/src/pymonkey.txt	Sun Aug 09 15:37:29 2009 -0700
@@ -49,6 +49,11 @@
 
       Returns the :class:`Runtime` that the object belongs to.
 
+.. class:: Function
+
+   This is the type of JavaScript functions, which is a subtype of
+   :class:`Object`.
+
 .. class:: Context
 
    This is the type of JavaScript context objects. Contexts can only
@@ -71,15 +76,35 @@
       stored within the new JS object; it can be retrieved using
       :meth:`get_object_private()`.
 
+   .. method:: new_function(callable, name)
+
+      Creates a new :class:`Function` instance that wraps the
+      given Python callable.  In JS-land, the callable will
+      have the given name.
+
    .. method:: get_object_private(object)
 
       Returns the ``private_obj`` passed to :meth:`new_object()`
       when `object` was first created. If it doesn't exist, ``None``
       is returned.
 
+      If `object` was created with :meth:`new_function()`, then this
+      method returns the Python callable wrapped by `object`.
+
       This functionality is useful if you want to represent Python
       objects in JS-land.
 
+   .. method:: clear_object_private(object)
+
+      Clears the ``private_obj`` passed to :meth:`new_object()`
+      when `object` was first created. If it doesn't exist, this
+      function returns nothing.
+
+      If `object` was created with :meth:`new_function()`, then this
+      method effectively "unbinds" the Python callable wrapped by
+      `object`. If `object` is later called, an exception will be
+      raised.
+
    .. method:: init_standard_classes(object)
 
       Defines the standard JavaScript classes on the given