help "too active" misfeature

Emile van Sebille emile at fenx.com
Sat Sep 1 07:37:39 EDT 2001


Note that this still occurs in current cvs, and that since 2.1 there is no
need to import help and when you don't things work right.  Otherwise,
setting the __repr__ and __str__ functions in class Helper of pydoc.py to:

    def __str__(self):
        if inspect.stack()[1][3] == '?':
            self()
            return ''
        return '<pydoc.Helper instance>'

    def __repr__(self):
        return '<pydoc.Helper instance>'

also appears to fix the proble.



--

Emile van Sebille
emile at fenx.com

---------
"Emile van Sebille" <emile at fenx.com> wrote in message news:...
>
> "Roman Suzi" <rnd at onego.ru> wrote in message
> news:mailman.999335946.22915.python-list at python.org...
> > This reminds me of fabulous MS Outlook Express behaviour:
> >
> > >>> from pydoc import help
> > >>> globals()
> > {
> > ...
> >
> > help>
> >
> > ;-)
> >
> >





More information about the Python-list mailing list