Now that James has weighed in. Just some comments on compatibility if someone does complain about python-2.4 compat.
On Thu, Jul 26, 2012 at 01:37:54PM +0200, Zdeněk Pavlas wrote:
>
> Q: Does it still run under Python2?
> A: Yes, that was the main focus. Python 2.6+ is required.
>
> [PATCH 1/4] python3-compat: raise
>
> Patch all raise statements to use the new 1-arg syntax
>
The raise syntax should be compatible back to python-2.4 (Possibly before,
I only have back to 2.4 to test against)
> [PATCH 2/4] python3-compat: except
>
> Patch all except statements to use the new 'as' syntax.
>
There's no equivalent for this in older python. It is a nicer syntax
(especially when catching multiple exceptions) The python-2.4 compatible
workaround that James mentioned is ugly but hopefully it doesn't come to that.
> [PATCH 3/4] python3-compat: print
>
> Turn the print function on, and use it.
>
If you need backwards compatibility, the print changes can be done this way
instead:
- print 'simple expressions %s %s' % ('work', 'fine')
+ print ('simple expressions %s %s' % ('work', 'fine'))
- print >> stderr 'These were perlish anyway'
+ import sys
+ sys.stderr.write('These were perlish anyway\n')
> [PATCH 4/4] python3-compat: handle renamed modules and types
>
> Handle the random renaming of python modules.
This one's ugly but I don't know a way around it. It shouldn't interfere
with python-2.4 compat if needed.
One thing to note is that until pycurl ports, you don't know whether this is
going to be enough to be python3 compatible. PyCurl is talking to C code
that's transfering data over the wire. Therefore it's going to have to make
decisions about bytes vs str objects when it ports. Then you'll need to
deal with those decisions in your code.
SOme of the changes to more recent python3 (I believe python3.2 but it might
have been in python-3.1 and I just forgot) make using str type for things
that are text even with potentially undecodable characters more attractive.
So it's hard to guess which way a lower level library like pycurl will jump.
-Toshio
pgpjxzqyRyTrB.pgp
Description: PGP signature
_______________________________________________ Yum-devel mailing list [email protected] http://lists.baseurl.org/mailman/listinfo/yum-devel
