Hi,

>> These changes are not enough to port nova to Python 3. But they are required 
>> to be able to find next Python 3 bugs.

> 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) 

I read that hacking has some checks. It's quite easy to run 2to3 to see 
modified lines.

Personally, I prefer to just run tests and fix issues one by one. It's faster 
to fix failing tests without having the modify the whole project at one.

Sometimes, I'm also using regular expressions (in vim or grep). For example, I 
used "[0-9]+L" to find 123L. You can also use regex to modify code inplace.

2to3 tool drops Python 2 compatibility, so it's not great. But it helps to find 
code that needs to be modified.

I now prefer 2to6 which uses six and so keeps Python 2 compatibility. I 
modified it a little bit to reduce changes:
https://github.com/haypo/2to6/

Victor

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to