beazley at cs.uchicago.edu
Wed Jun 16 15:23:32 CEST 1999
Fredrik Lundh writes:
> my good friend the mad scientist (the guy who writes code,
> not the flaming cult-ridden brainwashed script kiddie) has
> considered writing a whole new "abstract file" backend, to
> entirely get rid of stdio in the Python core. some potential
> -- performance (some stdio implementations are slow)
> -- portability (stdio doesn't exist on some platforms!)
> -- opens up for cool extensions (memory mapping,
> pluggable file handlers, etc).
> should I tell him to start hacking?
I am not in favor of obscuring Python's I/O model too much. When
working with C extensions, it is critical to have access to normal I/O
mechanisms such as 'FILE *' or integer file descriptors. If you hide
all of this behind some sort of abstract I/O layer, it's going to make
life hell for extension writers unless you also provide a way to get
access to the raw underlying data structures. This is a major gripe
I have with the Tcl channel model--namely, there seems to be no easy
way to unravel a Tcl channel into a raw file-descriptor for use in C
(unless I'm being dense and have missed some simple way to do it).
Also, what platforms are we talking about here? I've never come
across any normal machine that had a C compiler, but did not have stdio.
Is this really a serious problem?
More information about the Python-Dev