Re: [pywin32-checkins] py3k status
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@sk...> - 2008-11-14 22:47:46
|
> [... snip ...] and the py3k branch will be able to be retired. > > There is still a fair bit to go to get there though - specifically > in bytes and buffer handling. > > Here's what I used in my py3k attempt: > try: > memoryViewType = memoryview # will work in p3k > except NameError: > memoryViewType = types.BufferType # will work in 2.6 > memoryview = buffer The rest of pywin32 needs some help for byte literals etc. I've an idea I've run past Roger that might work but I'm yet to see how practical it is. Certainly the above is good to get going! > Okay: I have killed off my crufty CVS checkout and pulled a bzr branch. > (Wow, that was easy!) > I will re-merge my newer stuff from py3k into that trunk. Just to be clear - launchpad hosts a "trunk mirror" and a "py3k integration branch" - please send patches against the latter, not the former. > I want to do > more of the version-specific stuff at import time, so I want to do some > more refactoring anyway. In reviewing the merge changes, I see many > things like: > if win32: > f = rs.Fields[i] > else: # Iron Python > f = rs.Fields.Item[i] > which I'ld like to re-code, if I can, to get rid of the "if" at run > time. > Would something like: > f = getItemValue(rs.Fields,i) > be too confusing? Actually, I think you will find that 'rs.Fields[i]' is just a "shortcut" for 'rs.Fields.Item[i]' by making use of the "default property". So I suspect that you could use the ironpython version in win32 too. If so a simple comment would then do. Cheers, Mark |