[Python-Dev] bug 576990

Roeland Rengelink rengelin@strw.leidenuniv.nl
Wed, 25 Sep 2002 12:46:15 +0200


Guido van Rossum wrote:
> 
> > Roeland Rengelink <rengelin@strw.leidenuniv.nl> writes:
> >
> > > 5. This is clearly a profound and interesting bug, but solving this
> > > seems to involve cans of worms, ten-foot poles, and a re-write of the
> > > core.
> 
> [Martin]
> > To me, it sounds like this. This has been changed forth and back, and
> > in every state, somebody is unhappy.
> 
> Yes, it's very messy, see my comments to the SF bug entry.  I see no
> fix that doesn't break something else.
> 
> Note that this "worked" in the initial 2.2 release only when the
> subclass didn't have a docstring of its own:
> 
> >>> class P(property):
> ...   "This is class P"
> ...
> >>> p = P(None, None, None, "this is property p")
> >>> p.__doc__
> 'This is class P'
> >>>
> 
> The best workaround is I can see that works everywhere is:
> 
> class P(property):
>     "class P's docstring"
>     __doc__ = property.__dict__['__doc__']
> 
> --Guido van Rossum (home page: http://www.python.org/~guido/)

Thanks for the response and thanks for the workaround. It does solve my
immediate problem, and I can live with losing "class P's docstring" in
pydoc.

I wish I could do more to help though,

Roeland