[Python-Dev] The os module, unix and win32
Guido van Rossum
guido at python.org
Fri Jan 9 11:19:51 EST 2004
> [Dave]
>
> >> Another possibility: we'd get a lot more mileage out of simply
> >> adding ctypes to the standard install. That would solve the
> >> immediate popen problem, let us get rid of _winreg entirely (and
> >> replace it with a pure Python version), and make future Win32
> >> problems easier to solve.
>
> [Guido]
> > I don't know that a Python version of _winreg using ctypes would be
> > preferable over a C version.
>
> Since there is a C version, there's no need to code it in Python again.
>
> > I'd expect it to be slower, less readable than the C version, and more
> > susceptible to the possibility of causing segfaults.
>
> Slower: yes, but I don't know how much.
> Less readable: no, more readable.
> Susceptible to segfaults: If written correctly, it should be bullet
> proof - exactly the same as a C version.
But the version that was referenced here before isn't bulletproof,
right? Wouldn't the bullet-proofing reduce the readability?
> > That doesn't mean I don't think ctypes is a good idea -- just that I
> > don't think applying it to _winreg would be useful.
>
> Cool.
>
> Should this be a Windows only version, or cross-platform?
I don't know enough about ctypes and its user community to answer that
(I doubt I'd have much direct need for it myself). But in general I'm
biased towards cross-platform tools.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list