[Python-bugs-list] [ python-Bugs-446874 ] 2.2a1: constructors have no docstring

noreply@sourceforge.net noreply@sourceforge.net
Tue, 07 Aug 2001 10:35:24 -0700


Bugs item #446874, was opened at 2001-08-01 10:47
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=446874&group_id=5470

Category: type/class unification
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Guido van Rossum (gvanrossum)
Summary: 2.2a1: constructors have no docstring

Initial Comment:
In 2.2a1 the constructors of the builtin types don't 
have docstrings:

>>> list.__init__
<slot wrapper '__init__' of 'list' objects>
>>> list.__init__.__doc__
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: 'wrapper_descriptor' object has no 
attribute '__doc__'

If this can't be fixed, the documentation for the 
constructor arguments should be part of the docstring 
for the type object as it's done for list, but not for 
dictionary:
>>> print list.__doc__
list() -> new list
list(sequence) -> new list initialized from sequence's 
items
>>> print dictionary.__doc__
dictionary type

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-07 10:35

Message:
Logged In: YES 
user_id=6380

Closing this, because the main complaint has been fixed.
I'll fix the docstring of dictionary when I fix the
constructor (thjere's a separate bug report open for that
anyway).

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-01 13:35

Message:
Logged In: YES 
user_id=6380

Good catch!  Turns out wrapper descriptors do have
docstrings (albeit rather generic ones), but the necessary
things to extract these were omitted.  I've fixed this in
CVS now.

I'll fix the dictionary docstring when I've decided on the
signature.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=446874&group_id=5470