Re: [PATCH 2/2] Make aap more Python 3.x forward compatible

Leandro Lucarella <[email protected]> Mon, 6 Apr 2009 15:28:40 -0300
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Bram Moolenaar, el  6 de abril a las 20:10 me escribiste:
> 
> Leandro Lucarella wrote:
> 
> > This patch changes 2 things:
> > 1) Try to use html or HTMLParser module first, then use htmllib module
> > 2) Use the "in" operator instead of the "has_key()" method
> 
> I'm very glad that you take the time to make improvements.
> 
> At this moment i'm not so concerned about Python 3.x support.  It's not
> backwards compatible with 2.x and, as far as I know, it's impossible to
> write a Python script that runs on both 2.x and 3.x.  I rather stick
> with Python 2.x for a while, since every system should have that
> version.  Aap is actually compatible with Python 1.5x to maximize the
> number of systems it runs on.
> 
> What is the advantage of using "in" instead of "has_key()?

Both changes are for "improved Python 3.x compatibility" (they try to
minimize the gap between Python 2.x and Python 3.x compatible code).

"has_key()" method is removed from Python in 3.x series (the same goes for
the "htmllib" module).

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com