help() on stdout.closed

Fredrik Lundh fredrik at pythonware.com
Wed Jun 21 06:27:06 EDT 2006


Pekka Karjalainen wrote:

>>>> from sys import stdout
>>>> help (stdout.closed)
>
> If I do this, it gives me help on the bool object.

that's probably because "sys.stdout.closed" *is* a bool object:

>>> sys.stdout.closed
False
>>> type(sys.stdout.closed)
<type 'bool'>

there's no way the reflection system can figure out how a given boolean was
created; all it knows is that it gets an object of a given type.

> Other docstrings in sys.stdout work fine.

have you tried things like

>>> help(sys.stdout.name)

and

>>> help(sys.stdout.write("hello"))

?

</F> 






More information about the Python-list mailing list