Secret readinto() method for file objects?

Tim Peters tim.one at home.com
Mon May 21 08:44:31 CEST 2001


[Ryan LeCompte]
> Just doing a simple test to see what's inside a file object in Python 2.1,
> and I find:
>
> >>>file = open('test.txt', 'w')
> >>>dir(file)
> ['close', 'closed', 'fileno', 'flush', 'isatty', 'mode', 'name', 'read',
> 'readinto', 'readline', 'readlines', 'seek', 'softspace', 'tell',
> 'truncate', 'write', 'writelines', 'xreadlines']
> >>>file.readinto
> <built-in method readinto of file object at 00B33060>
> >>>file.readinto.__doc__
> >>>
>
> The above file object method has no helpful doc string, nor is it
> documented at
> http://www.python.org/doc/current/lib/bltin-file-objects.html

Correct on both counts.

> Has someone secretly developed a new standard file object method without
> letting us know? =)

Yes, but it's been sitting there a long time by now.  As soon as it's of any
conceivable use, it will get documented.  Or perhaps it will just go away
stillborn.

> Also... a side note: It would be nice if Python had doc strings for ALL
> of its builtin modules and their respective classes/methods/functions.

SourceForge is open for patches 24 hours a day.

take-a-docstring-leave-a-docstring-ly y'rs  - tim





More information about the Python-list mailing list