New submission from Nick Edds <[EMAIL PROTECTED]>: This is a small patch to the 2to3 tool, replacing some calls to isinstance (x,y) with type(x) is y in the file pytree.py. Although there is only a slight performance increase for each time this change is made, the recursive nature of pattern matching means that isinstance was being calling hundreds of thousands of times per file, so overall these minor changes result in a 3-4% speed increase in my limited testing. It currently fails only one test due to line 432 in test_pytree, because I had to rename the type parameter to new_type so I could call type() on something. But with the line in the test file changed, it passes all tests.
---------- assignee: collinwinter components: 2to3 (2.x to 3.0 conversion tool) files: pytree.py messages: 68641 nosy: collinwinter, nedds severity: normal status: open title: 2to3 Slight Patch type: performance versions: Python 2.6 Added file: http://bugs.python.org/file10713/pytree.py _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3182> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com