Kudos to documentors: (popen2)

Robb Shecter shecter at darmstadt.gmd.de
Thu Aug 19 12:36:10 EDT 1999


"Fred L. Drake, Jr." wrote:
>... I'd like to point out that
> ...it is based on
> language semantics and not on presentation.  

Hi,

That's what I was trying to say!  I think that my writing was not too
clear - I was trying to say that the Java and Python doc systems
should be used as examples for other languages.

It'd be cool if parameters and return values were hyperlinked to the
definitions of their types, but I don't think that'd be possible in a
dynamically typed language.  Maybe this isn't such a big problem for
programmers who are used to working with it.

It did bug me, though, because my scenario looked like this:

1) I wanted to start a subprocess and get its stdout and stdin.  Using
the library reference and indexes, it was very easy to find popen2.

2) From that page I got the module and method name I needed.  Great.

3) I needed to know how to work with the return values.  The page says
"Returns (child_stdout, child_stdin)".  I got stuck here.  Without the
type, I didnt know how to read/write to them.  What I eventually did
was start a Python interpreter, do a method call, and print the
returned objects - which told me their types.  After -that-, I could
go back to the docs and see how to read and write to them.

It would have been great if their return types were listed, along with
hyperlinks to the appropriate docs.  But that wouldn't come for free
in a dynamically typed language, I guess.

Maybe my strategy for figuring the class out was incorrect... I do
most of my work in statically typed languages, so that may have an
influence.

- Robb




More information about the Python-list mailing list