[Python-Dev] Winreg recap (original) (raw)

Paul Prescod paul@prescod.net
Tue, 01 Aug 2000 12:52:45 -0400


I specifically asked everyone here if an abstraction was a good idea. I got three + votes and no - votes. One of the + votes requested that we still ship the underlying module. Fine. I was actually pointed (on python-dev) to specs for an abstraction layer that AFAIK had been designed on Python-dev.

Back then, I said:

> I've just had a chance to look at the winreg module. I think that it is > too low-level.

Mark Hammond said:

I agree. There was a proposal (from Thomas Heller, IIRC) to do just this. I successfully argued there should be 2 modules for Python - the raw low-level API, which guarantees you can do (almost) anything. A higher-level API could cover the 80% of cases. ... I have no real problem with your proposed design, as long as it it written in Python, using the low-level API. It could be called "registry" or I would even be happy for "winreg.pyd" -> "winreg.pyd" and your new module to be called "winreg.py"

Gordon pointed me to the spec. I took it and expanded on it to cover a wider range of cases.

So now I go off and code it up and in addition to complaining about one detail, I'm also told that there is no real point to having a high level API. Windows users are accustomed to hacks and pain so crank it up!

FWIW, I ignored all the winreg modules, and all the debate about them. Why? Just because Mark's had been in use for years already, so was already battle-tested. There's no chance that any other platform will ever make use of this module, and given that its appeal is thus solely to Windows users, it was fine by me if it didn't abstract anything away from MS's Win32 API.

It is precisely because it is for Windows users -- often coming from VB, JavaScript or now C# -- that it needs to be abstracted.

I have the philosophy that I come to Python (both the language and the library) because I want things to be easy and powerful at the same time. Whereever feasible, our libraries should be cleaner and better than the hacks that they cover up. Shouldn't they? I mean even Microsoft abstracted over the registry API for VB, JavaScript, C# (and perhaps Java). Are we really going to do less for our users?

To me, Python (language and library) is a refuge from the hackiness of the rest of the world.

-- Paul Prescod - Not encumbered by corporate consensus "I don't want you to describe to me -- not ever -- what you were doing to that poor boy to make him sound like that; but if you ever do it again, please cover his mouth with your hand," Grandmother said. -- John Irving, "A Prayer for Owen Meany"