<div dir="ltr"><div class="gmail_quote">On Thu, 23 Apr 2015 at 17:11 Victor Stinner <<a href="mailto:vstinner@redhat.com">vstinner@redhat.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As announced, changes are boring, just obvious Python2/Python3 issues:<br>
<br>
- strip L from long integer literals: 123L => 123<br>
- replace dict.iteritems() with six.iteritems(dict)<br>
- replace list.sort(cmp_func) with list.sort(key=key_func)<br>
- replace "raise exc_info[0], exc_info[1], exc_info[2]" with six.reraise(*exc_info)<br>
- moved functions / modules<br>
<br>
  * get http.client, urllib.request and other stdlib modules from six.moves since they moved between Python 2 and Python 3<br>
  * get itertools.izip/zip_longest from six.moves<br>
  * replace unichr() with six.unichr()<br>
<br>
- replace filter(func, data) with [item for item in data if func(item)]<br>
- replace unicode() with six.text_type<br>
- replace (int, long) with six.integer_types<br>
- replace file() with open()<br>
- replace StringIO() with six.StringIO()<br>
<br>
These changes are not enough to port nova to Python 3. But they are required to be able to find next Python 3 bugs.</blockquote><div><br></div><div>Is there already a static analysis tool that helps find these things?  (Would a pylint check for the above be useful?  Some of them would be hard to find reliably, but a bunch of the above would be trivial)</div><div><br></div><div> - Gus</div></div></div>