The standard library

Quinn Dunkan quinn at regurgitate.ugcs.caltech.edu
Mon Jul 2 21:46:33 EDT 2001


On Sat, 30 Jun 2001 22:39:51 -0700, Paul Prescod <paulp at ActiveState.com> wrote:
> * why do we need a "stat" module for interpreting stat() results. Why
>aren't stat's results self-describing? (i.e. an object)

This has always bugged me.  Wherever I go, I bring along python modules that
wrap pwd.*, grp.*, os.stat, time.*, etc. to provide a more reasonable
interface.  Then I wind up writing some throwaway script somewhere, for which
installing and importing my wrapper module is not worth it, so I grope through
some documentation and put in bare indexes.  Then the script grows, and bare
integers slow me down when I'm trying to read it, so I do
'pw_name, pw_this, pw_that = range(n)', and then the script grows more and I
wind up having to import those constants elsewhere, and I realize what I
should have realized in the beginning:  I should have used my wrappers all
along.

Usually when python wraps C the interface gets higher level and easier to use,
but flattening structs into arrays goes in the other direction.

Sorry, just a pet peeve.  Anyway, that was basically a long-winded "me too".

And a lot of C functions that could (and should) accept keyword arguments
don't.  Even when the docs suggest they do, they don't.  For example, you
should be able to write 'foo bar baz'.split(maxsplit=1)

I don't know Py_ParseArgs or whatever its called... maybe C functions *can't*
have keyword args.



More information about the Python-list mailing list