Merge lp:~jml/pkgme/tweaks into lp:pkgme
Proposed by
Jonathan Lange
Status: | Merged |
---|---|
Approved by: | James Westby |
Approved revision: | 67 |
Merged at revision: | 63 |
Proposed branch: | lp:~jml/pkgme/tweaks |
Merge into: | lp:pkgme |
Diff against target: |
62 lines (+8/-9) 3 files modified
pkgme/backend.py (+6/-7) pkgme/backends/python/all_info (+1/-1) pkgme/tests/test_backend.py (+1/-1) |
To merge this branch: | bzr merge lp:~jml/pkgme/tweaks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby | Approve | ||
Review via email: mp+67729@code.launchpad.net |
Description of the change
Bunch of tweaks to remove pyflakes and to use slightly more modern (and probably faster) approaches where needed.
* Use key, not cmp (changes algorithmic complexity from N**2 to max(N, O(sort(N)))
* Use try_imports to import things based on availability
* Don't assign to unused variables
To post a comment you must log in.
Oh also, changed the Python backend to use json.load rather than json.loads. All that means is that we let json worry about how much of the stream to store in memory, rather than loading it all in first.