[Python-Dev] Proposal for new core module: UserFIle

Keith Dart kdart at kdart.com
Fri Dec 12 18:38:43 EST 2003

On Fri, 2003-12-12 at 14:55, Martin v. Löwis wrote:
> Keith Dart <kdart at kdart.com> writes:
> > Attached is a module provides enhanced functionality for file objects.
> If you want your code to be included in Python, posting it to
> python-dev may not be a good idea - it is, in fact, a guarantee that
> it will *not* be included. Instead, all patches should go to
> sf.net/projects/python.

Thank you for responding. The purpose of posting here was to get some
feedback on the modules (which I certainly did!). I will clean up and
post the ones that had the most interest to sourceforge. 

> That is not a guarantee that it will be included, either. This module
> (UserFile) puts together way too many individual feature to allow a
> meaningful review.

Yes, I agree. It should be broken up into at least two modules.

> Looking at a single class alone (UserFile), my review would be this:
> 1. What is the purpose of hiding EINTR?

My code uses a lot of interrupts (SIGALRM, SIGIO, SIGCHLD, ...) and I
almost always need to trap and restart interrupted system calls. So I
made that wrapper. Nearly all I/O uses it. In fact, I think it should be
the default behavior.... 

> 2. Many of the os wrappers should be methods on the file object,
>    if they are useful in the first place (e.g. ttyname, fstat,
>    dup)

I agree again. I don't know why that is not currently the case. So I
have to write a wrapper (not wanting to have a custom hacked Python

> 3. This code might not be universally work on all supported systems;
>    this should be addressed somehow.

True again. I write and deploy only on Posix (Linux and FreeBSD) so
perhaps others will have to add other platform support.

> 4. There is no documentation.
> 5. There are no test cases.

Again, these were posted just to get some valuable feedback before I did
those things.

Thanks for your feedback!

-- ------------------------------------------------------------------------- 
Keith Dart
<mailto:kdart at kdart.com>
Public key ID: B08B9D2C Public key: <http://www.kdart.com/~kdart/public.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20031212/67b38533/attachment.bin

More information about the Python-Dev mailing list