[pypy-svn] r28992 - in pypy/dist/pypy/objspace: . std

arigo at codespeak.net arigo at codespeak.net
Tue Jun 20 13:48:23 CEST 2006


Author: arigo
Date: Tue Jun 20 13:48:22 2006
New Revision: 28992

Modified:
   pypy/dist/pypy/objspace/std/complextype.py
   pypy/dist/pypy/objspace/std/stdtypedef.py
   pypy/dist/pypy/objspace/std/typetype.py
   pypy/dist/pypy/objspace/thunk.py
Log:
A few docstrings, more to come.


Modified: pypy/dist/pypy/objspace/std/complextype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/complextype.py	(original)
+++ pypy/dist/pypy/objspace/std/complextype.py	Tue Jun 20 13:48:22 2006
@@ -14,7 +14,8 @@
 OVERFLOWED_FLOAT = 1e200
 OVERFLOWED_FLOAT *= OVERFLOWED_FLOAT
 
-complex_conjugate = StdObjSpaceMultiMethod('conjugate', 1)
+complex_conjugate = StdObjSpaceMultiMethod('conjugate', 1,
+                                           doc="(A+Bj).conjugate() -> A-Bj")
 
 register_all(vars(),globals())
 

Modified: pypy/dist/pypy/objspace/std/stdtypedef.py
==============================================================================
--- pypy/dist/pypy/objspace/std/stdtypedef.py	(original)
+++ pypy/dist/pypy/objspace/std/stdtypedef.py	Tue Jun 20 13:48:22 2006
@@ -264,6 +264,8 @@
         unwrap_spec.append('w_args')        
     if multimethod.extras.get('general__args__', False):
         unwrap_spec.append(argument.Arguments)
+    if 'doc' in multimethod.extras:
+        func.__doc__ = multimethod.extras['doc']
     return gateway.interp2app(func, app_name=methname, unwrap_spec=unwrap_spec)
 
 def slicemultimethod(space, multimethod, typedef, result, local=False):

Modified: pypy/dist/pypy/objspace/std/typetype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/typetype.py	(original)
+++ pypy/dist/pypy/objspace/std/typetype.py	Tue Jun 20 13:48:22 2006
@@ -80,6 +80,7 @@
     return space.newtuple(w_type.mro_w)
 
 def descr_mro(space, w_type):
+    """Return a type's method resolution order."""
     w_type = _check(space, w_type,"expected type")
     return space.newlist(w_type.compute_mro())
 
@@ -140,6 +141,7 @@
     w_type.dict_w['__module__'] = w_value
 
 def descr___subclasses__(space, w_type):
+    """Return the list of immediate subclasses."""
     w_type = _check(space, w_type)
     subclasses_w = []
     for w_ref in w_type.weak_subclasses_w:

Modified: pypy/dist/pypy/objspace/thunk.py
==============================================================================
--- pypy/dist/pypy/objspace/thunk.py	(original)
+++ pypy/dist/pypy/objspace/thunk.py	Tue Jun 20 13:48:22 2006
@@ -61,15 +61,19 @@
     return w_self
 
 def thunk(w_callable, __args__):
+    """thunk(f, *args, **kwds) -> an object that behaves like the
+    result of the call f(*args, **kwds).  The call is performed lazily."""
     return W_Thunk(w_callable, __args__)
 app_thunk = gateway.interp2app(thunk, unwrap_spec=[baseobjspace.W_Root,
                                                    argument.Arguments])
 
 def is_thunk(space, w_obj):
+    """Check if an object is a thunk that has not been computed yet."""
     return space.newbool(w_obj.w_thunkalias is w_NOT_COMPUTED_THUNK)
 app_is_thunk = gateway.interp2app(is_thunk)
 
 def become(space, w_target, w_source):
+    """Globally replace the target object with the source one."""
     w_target = force(space, w_target)
     w_target.w_thunkalias = w_source
     return space.w_None



More information about the Pypy-commit mailing list