Why does value of __doc__ not a String type? 
Author Message
 Why does value of __doc__ not a String type?


>>> import types
>>> type(types.BuiltinFunctionType.__doc__)
>>> <type 'getset_descriptor'>



Posted via http://www.*-*-*.com/

Tue, 24 Jan 2006 18:09:39 GMT  
 Why does value of __doc__ not a String type?


> Hi,

>>>> import types
>>>> type(types.BuiltinFunctionType.__doc__)
>>>> <type 'getset_descriptor'>

What string would you like it to be?  Whatever string value you
choose, that's the one and only string that would then be shown
for ANY builtin function or method... not very informative.  As
it is, instead, a descriptor, its __get__ method gets called,
when you access __doc__ on any given builtin function of method,
and that __get__ knows where to find the builtin's docstring
and return it.


Tue, 24 Jan 2006 20:29:07 GMT  
 Why does value of __doc__ not a String type?


> What string would you like it to be?

Clearly, it should be PyCFunction_Type.tp_doc. This is NULL in
all python releases. If it wasn't NULL, I think
BuiltinFunctionType.__doc__ would return the string, yet
hex.__doc__ would still use the accessor.


Tue, 24 Jan 2006 20:42:36 GMT  
 [ 3 post ] 

 Relevant Pages 

1. String#== : Why not error with different type?

2. Why Forth is not doing so well

3. doc string substition and overloading __doc__

4. newbie: data type , why wrong values?

5. FORTRAN+VB : TYPE with String / get BSTRING value ?

6. Why default values not taken?

7. type of IS mapped values does not match

8. Why default parameter value not working?

9. Why not using functional Types?

10. Why are types not hashable?

11. Why was typed lambda calculus not used?

12. patch for string.findall (why not, theres an re.findall)


Powered by phpBB® Forum Software