)]}'
{"nova/tests/unit/api/openstack/test_common.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"66bfede0c795482c3c3ff7bd8ac770bfd1b361f2","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"from six.moves import range"},{"line_number":23,"context_line":"from testtools import matchers"},{"line_number":24,"context_line":"import webob"},{"line_number":25,"context_line":"import webob.exc"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_21cff2b4","line":22,"updated":"2016-01-07 16:55:07.000000000","message":"Import modules, not objects, even for six.moves.range().  Reason is that now it is not clear that we\u0027re using six\u0027s version of range as opposed to standard Python range.","commit_id":"3d39f1ee33949016662e63fa15b48bd9437bf7c4"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"efe8a49aeff26d0991f7a0b5765af08cc24a0344","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"from six.moves import range"},{"line_number":23,"context_line":"from testtools import matchers"},{"line_number":24,"context_line":"import webob"},{"line_number":25,"context_line":"import webob.exc"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_da2f869f","line":22,"in_reply_to":"fa69d971_07296c37","updated":"2016-01-08 17:12:33.000000000","message":"I\u0027m not objecting to your use of six.moves.range(); I\u0027m objecting to you importing the _object_ range.  Our style guidelines require you to import modules only.  One way you could comply with that style rule would be to eliminate this import altogether and replace all \u0027range()\u0027 calls with calls to \u0027six.moves.range()\u0027.","commit_id":"3d39f1ee33949016662e63fa15b48bd9437bf7c4"},{"author":{"_account_id":17600,"name":"sandeep nandal","email":"sandeep@nandal.in","username":"nandal"},"change_message_id":"5502998bae6ef5aa825eca77f5b95c04f0d97abb","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import mock"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"from six.moves import range"},{"line_number":23,"context_line":"from testtools import matchers"},{"line_number":24,"context_line":"import webob"},{"line_number":25,"context_line":"import webob.exc"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_07296c37","line":22,"in_reply_to":"fa69d971_21cff2b4","updated":"2016-01-08 07:15:15.000000000","message":"Hi Kevin,\n\nIn Liberty Release Notes for nova, i found a blueprint \"Started on the road towards Python 3.4 support\" https://blueprints.launchpad.net/nova/+spec/nova-python3\n\nafter that i further look for the information on other openstack projects to add support for python3 and found https://review.openstack.org/#/c/150056/3 as a merged in glance to use six.moves.range() to support both python2 and python3.\n\nsix.moves.range() works as xrange() in python2 and range() in python3, it doesn\u0027t return a list, although  it\u0027s better to use xrange() over range() in python2, if we use range() imported from six.moves, it will make code more readable instead of using xrange() n range() separately, It also add uniformity to code besides adding support  to python2 n python3.","commit_id":"3d39f1ee33949016662e63fa15b48bd9437bf7c4"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"2d3ff67bbda590633bd3bfb18bf2296e168dc58e","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def test_limiter_custom_max_limit(self):"},{"line_number":136,"context_line":"        # Test a max_limit other than 1000."},{"line_number":137,"context_line":"        items \u003d list(six.moves.range(2000))"},{"line_number":138,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d1\u0026limit\u003d3\u0027)"},{"line_number":139,"context_line":"        self.assertEqual("},{"line_number":140,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[1:4])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_0ff637d7","line":137,"range":{"start_line":137,"start_character":31,"end_line":137,"end_character":36},"updated":"2016-01-13 17:21:52.000000000","message":"I would prefer to continue to simply use range(2000), but cast to list above on subscript:","commit_id":"f85384c4837eff8bee0629c782cbf5f3d25293e9"},{"author":{"_account_id":17600,"name":"sandeep nandal","email":"sandeep@nandal.in","username":"nandal"},"change_message_id":"fdc7f37f74982a58e60d6854790cacf7373746d1","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def test_limiter_custom_max_limit(self):"},{"line_number":136,"context_line":"        # Test a max_limit other than 1000."},{"line_number":137,"context_line":"        items \u003d list(six.moves.range(2000))"},{"line_number":138,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d1\u0026limit\u003d3\u0027)"},{"line_number":139,"context_line":"        self.assertEqual("},{"line_number":140,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[1:4])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_b0a3b0b1","line":137,"range":{"start_line":137,"start_character":31,"end_line":137,"end_character":36},"in_reply_to":"da6ed579_0ff637d7","updated":"2016-01-14 06:55:50.000000000","message":"Hi Victor,\ncommon.limited() expects first argument as a list, and if we pass xrange() as first argument, it complains, I had run the tests by changing range() to xrange() on python2.7 without casting to list, the tests results are failed.\nxrange() on python2.7 simulates the same result of range() on python3.\n\nregarding the comment to cast to list above on subscript only, the items list is created as list only once, for the purspose to be used as list after that, so it\u0027s better to cast the list once, then use is as list any times as needed.\nHere we can see, common.limited() is called many times.\n\nIt helps in readability as well as also help in efficiency.\nsame goes, for the other file.","commit_id":"f85384c4837eff8bee0629c782cbf5f3d25293e9"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"5e883a66cdea35a214947cf192a1a44a6c886d7f","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def test_limiter_custom_max_limit(self):"},{"line_number":136,"context_line":"        # Test a max_limit other than 1000."},{"line_number":137,"context_line":"        items \u003d list(six.moves.range(2000))"},{"line_number":138,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d1\u0026limit\u003d3\u0027)"},{"line_number":139,"context_line":"        self.assertEqual("},{"line_number":140,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[1:4])"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_e4ba0ee1","line":137,"range":{"start_line":137,"start_character":31,"end_line":137,"end_character":36},"in_reply_to":"da6ed579_b0a3b0b1","updated":"2016-01-21 16:01:03.000000000","message":"At least, replace list(six.moves.range(2000)) with list(range(2000)).","commit_id":"f85384c4837eff8bee0629c782cbf5f3d25293e9"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"2d3ff67bbda590633bd3bfb18bf2296e168dc58e","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        items \u003d list(six.moves.range(2000))"},{"line_number":138,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d1\u0026limit\u003d3\u0027)"},{"line_number":139,"context_line":"        self.assertEqual("},{"line_number":140,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[1:4])"},{"line_number":141,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d3\u0026limit\u003d0\u0027)"},{"line_number":142,"context_line":"        self.assertEqual("},{"line_number":143,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[3:])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_8f30e79f","line":140,"range":{"start_line":140,"start_character":62,"end_line":140,"end_character":63},"updated":"2016-01-13 17:21:52.000000000","message":"cast to list here: list(items[1:4])","commit_id":"f85384c4837eff8bee0629c782cbf5f3d25293e9"},{"author":{"_account_id":17600,"name":"sandeep nandal","email":"sandeep@nandal.in","username":"nandal"},"change_message_id":"fdc7f37f74982a58e60d6854790cacf7373746d1","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        items \u003d list(six.moves.range(2000))"},{"line_number":138,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d1\u0026limit\u003d3\u0027)"},{"line_number":139,"context_line":"        self.assertEqual("},{"line_number":140,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[1:4])"},{"line_number":141,"context_line":"        req \u003d webob.Request.blank(\u0027/?offset\u003d3\u0026limit\u003d0\u0027)"},{"line_number":142,"context_line":"        self.assertEqual("},{"line_number":143,"context_line":"            common.limited(items, req, max_limit\u003d2000), items[3:])"}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_f09da866","line":140,"range":{"start_line":140,"start_character":62,"end_line":140,"end_character":63},"in_reply_to":"da6ed579_8f30e79f","updated":"2016-01-14 06:55:50.000000000","message":"kindly, refer to the above comment","commit_id":"f85384c4837eff8bee0629c782cbf5f3d25293e9"}],"nova/tests/unit/db/test_migrations.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"c24e8ad993311580880517bd34e5d97ba5cbe663","unresolved":false,"context_lines":[{"line_number":42,"context_line":"from migrate import UniqueConstraint"},{"line_number":43,"context_line":"from migrate.versioning import repository"},{"line_number":44,"context_line":"import mock"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"from oslo_db.sqlalchemy import test_base"},{"line_number":47,"context_line":"from oslo_db.sqlalchemy import test_migrations"},{"line_number":48,"context_line":"from oslo_db.sqlalchemy import utils as oslodbutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_c7360803","line":45,"updated":"2016-01-12 17:43:38.000000000","message":"Eliminate this blank line.","commit_id":"7d9a2e8797f60995dd15a968572d701ed26a7150"}]}
