PyWin32 for Python 3.x

John Machin sjmachin at
Mon Mar 16 06:43:30 CET 2009

On Mar 16, 7:27 am, Tim Golden <m... at> wrote:


> people take to categorise their packages appropriately. It
> could well be the case that a number of packages will work
> in Python 3.x without modification but their entry probably
> won't reflect that unless their maintainer's gone to the
> trouble to test the package and update it.

Excuse me, but what I read in this newsgroup, supported by my
experience doing a triage port followed by a fullscale practice port
on each of 2 non-trivial packages that I maintain (xlrd and xlwt),
suggests that the likelihood of a pure Python module (let alone
package) working with Python 3.X (even after going through 2to3)
without modification is rather low ... unless it was rather small and
had been written expressly to work unchanged in 2.X and 3.X. [1] It's
been stated authoritatively that the subset of Python that will run
unchanged unported un2to3ed is "crippled". Many packages support old
versions of Python (xlrd back to 2.1; some of the effbot's goodies
(e.g. PIL) run on 1.5.2 even), increasing the effort required to
assess the scope of the port, let alone implement it.

IOW any package that isn't specified as being 3.X-ready is unlikely to
be 3.X-ready. And if it was ready, wouldn't you want to wait till the
maintainer had tested that it was, and published its readyness?

> Obviously, in the case of (Windows) extension modules,
> the module will at the very least need recompiling and
> rebuilding even if the code works without modification.

I could be wrong, but I got the impression that the C-API had changed
significantly from 2.x to 3.X and module initialisation had changed
drastically ... see (for example)
... Looks to me like the chance of any extension (Windows or not) not
requiring changes is zero.

[1]: I've written a pure-Python module for calculating Levenshtein
distance using a bit-parallel algorithm; it will work on 3.x unchanged
because it operates on two sequences which need to support only seq[x]
and len(seq) and whose elements need to be hashable and comparable and
not much else, and it doesn't import anything. This is very small,
recent, and deliberate, hence definitely not the norm.


More information about the Python-list mailing list