Python "header" files

beliavsky at aol.com beliavsky at aol.com
Tue Jun 8 22:47:13 CEST 2004


Ideally, one can use someone's C++ code by just looking at the header
files
(which should contain comments describing the functions in addition to
function definitions), without access to the full source code. Can
analogs of C++ header files be created for Python code?

Python "header" files could list only the 'def' statements and
docstrings of Python functions and classes, but that does not tell you
what the functions return. One could list the return statements as
well, but there can be several of them in a function, and they often
show HOW something is calculated, which is "too much information" for
a header file.

I wonder how Python projects with multiple programmers can be
coordinated without giving all programmers access to all of the source
code. I am currently working on one-man projects, but I am still
interested in ways of separating interface from implementation.



More information about the Python-list mailing list