[docs] [issue11776] Constructor signatures missing in types module documentation

Mike Hoy report at bugs.python.org
Thu Aug 23 12:36:12 CEST 2012


Mike Hoy added the comment:
I used the following for:
>>CodeType
>>FunctionType
>>LambdaType
>>SimpleNamespace
>>MethodType

--------------------
>>> print(CodeType.__doc__)
code(argcount, kwonlyargcount, nlocals, stacksize, flags, codestring,
 constants, names, varnames, filename, name, firstlineno,
 lnotab[, freevars[, cellvars]])
Create a code object. Not for the faint of heart.
>>> print(FunctionType.__doc__)
function(code, globals[, name[, argdefs[, closure]]])
Create a function object from a code object and a dictionary.
The optional name string overrides the name from the code object.
The optional argdefs tuple specifies the default argument values.
The optional closure tuple supplies the bindings for free variables.
>>> print(LambdaType.__doc__)
function(code, globals[, name[, argdefs[, closure]]])
Create a function object from a code object and a dictionary.
The optional name string overrides the name from the code object.
The optional argdefs tuple specifies the default argument values.
The optional closure tuple supplies the bindings for free variables.
>>> print(SimpleNamespace.__doc__) 
A simple attribute-based namespace.
namespace(**kwargs)
>>> print(MethodType.__doc__)
method(function, instance)
Create a bound instance method object.
--------------------
I left out the [] arguments.
I've stopped here and uploaded a patch for the 
>>'first easy part'. 

Despite that name I suspect I will have to change quite a few things. Once this part is done then I will move on the the 
>>'second easy part'

----------
keywords: +patch
versions: -Python 2.7, Python 3.2
Added file: http://bugs.python.org/file26969/issue11776-sigs-docs-first.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11776>
_______________________________________


More information about the docs mailing list

AltStyle によって変換されたページ (->オリジナル) /