Commits

Armin Rigo  committed 648159b

A few docstrings, more to come.

  • Participants
  • Parent commits d9df9ac

Comments (0)

Files changed (4)

File pypy/objspace/std/complextype.py

 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())
 

File pypy/objspace/std/stdtypedef.py

         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):

File pypy/objspace/std/typetype.py

     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())
 
     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:

File pypy/objspace/thunk.py

     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