PROPOSAL: [].__doc__, "".__doc__, ... 
Author Message
 PROPOSAL: [].__doc__, "".__doc__, ...

Hello,

I think it would be a nice feature for all types with methods to have
docstrings describing the methods, so [].__doc__ would be a string
with the descripion of .index, .append... etc.

What do you think?

regards,
Gerrit.

--
Comparison python GUI's: http://www.*-*-*.com/ ~gerrit/gui.html
Please comment!



Thu, 08 Aug 2002 03:00:00 GMT  
 PROPOSAL: [].__doc__, "".__doc__, ...

Quote:

> I think it would be a nice feature for all types with methods to have
> docstrings describing the methods, so [].__doc__ would be a string with
> the descripion of .index, .append... etc.

It already works, at least partly:

   >>> print [].append.__doc__
   L.append(object) -- append object to end

Still, `print [].__doc__' raises an exception.

--
Fran?ois Pinard   http://www.iro.umontreal.ca/~pinard



Fri, 09 Aug 2002 03:00:00 GMT  
 PROPOSAL: [].__doc__, "".__doc__, ...
<quote name="Fran?ois Pinard" date="951154699">

Quote:

> > I think it would be a nice feature for all types with methods to have
> > docstrings describing the methods, so [].__doc__ would be a string with
> > the descripion of .index, .append... etc.

> It already works, at least partly:

>    >>> print [].append.__doc__
>    L.append(object) -- append object to end

I know.

Quote:
> Still, `print [].__doc__' raises an exception.

I know. That's what I mean :)

regards,
Gerrit.

--
Comparison Python GUI's: http://www.nl.linux.org/~gerrit/gui.html
Please comment!



Sat, 10 Aug 2002 03:00:00 GMT  
 PROPOSAL: [].__doc__, "".__doc__, ...


Quote:
><quote name="Fran?ois Pinard" date="951154699">

>> > I think it would be a nice feature for all types with methods to have
>> > docstrings describing the methods, so [].__doc__ would be a string with
>> > the descripion of .index, .append... etc.

>> It already works, at least partly:

>>    >>> print [].append.__doc__
>>    L.append(object) -- append object to end

>I know.

>> Still, `print [].__doc__' raises an exception.

>I know. That's what I mean :)
>>> for method in dir([]):

        exec "print [].%s.__doc__" % method

L.append(object) -- append object to end
L.count(value) -> integer -- return number of occurrences of value
L.extend(list) -- extend list by appending list elements
L.index(value) -> integer -- return index of first occurrence of value
L.insert(index, object) -- insert object before index
L.pop([index]) -> item -- remove and return item at index (default last)
L.remove(value) -- remove first occurrence of value
L.reverse() -- reverse *IN PLACE*
L.sort([cmpfunc]) -- sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1



Sun, 11 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Vds doc V5.3 ( To sell doc v5.3 )

2. Logo1.doc and Math1.doc in cyberspace

3. grafting DOM doc [as a fragment] into another DOM doc [node]

4. doc string substition and overloading __doc__

5. Patches for tcl8.0/doc/* and tk8.0/doc/*

6. tcl8.0b1/doc and tk8.0b1/doc patches

7. [Doc-SIG] [development doc updates]

8. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

9. Language change proposal: make assertions "reusable"

10. NANS Proposal "pronounciation"

11. Proposal: "in" pseudo-operator

12. wish: "struct" module extension proposal

 

 
Powered by phpBB® Forum Software