)]}'
{"nova/virt/hardware.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"569ab9e74b97d1d40ded14e73bc4609adef8eead","unresolved":false,"context_lines":[{"line_number":1880,"context_line":"    return emu_threads_policy"},{"line_number":1881,"context_line":""},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"def get_pci_numa_policy_constraint("},{"line_number":1884,"context_line":"    flavor: \u0027objects.Flavor\u0027,"},{"line_number":1885,"context_line":"    image_meta: \u0027objects.ImageMeta\u0027,"},{"line_number":1886,"context_line":") -\u003e str:"},{"line_number":1887,"context_line":"    \"\"\"Validate and return the requested PCI NUMA affinity policy."},{"line_number":1888,"context_line":""},{"line_number":1889,"context_line":"    :param flavor: a flavor object to read extra specs from"},{"line_number":1890,"context_line":"    :param image_meta: nova.objects.ImageMeta object instance"}],"source_content_type":"text/x-python","patch_set":4,"id":"c4ddc3a9_7b4806ac","line":1887,"range":{"start_line":1883,"start_character":0,"end_line":1887,"end_character":66},"updated":"2021-03-04 17:32:04.000000000","message":"Valid but unrelated.","commit_id":"47cf817bacc61361189aaa7171422bb94d80b0c8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ead386dede1b12f75c86a494b0cfb842a2e41f78","unresolved":false,"context_lines":[{"line_number":1880,"context_line":"    return emu_threads_policy"},{"line_number":1881,"context_line":""},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"def get_pci_numa_policy_constraint("},{"line_number":1884,"context_line":"    flavor: \u0027objects.Flavor\u0027,"},{"line_number":1885,"context_line":"    image_meta: \u0027objects.ImageMeta\u0027,"},{"line_number":1886,"context_line":") -\u003e str:"},{"line_number":1887,"context_line":"    \"\"\"Validate and return the requested PCI NUMA affinity policy."},{"line_number":1888,"context_line":""},{"line_number":1889,"context_line":"    :param flavor: a flavor object to read extra specs from"},{"line_number":1890,"context_line":"    :param image_meta: nova.objects.ImageMeta object instance"}],"source_content_type":"text/x-python","patch_set":4,"id":"123c75a8_536a6b67","line":1887,"range":{"start_line":1883,"start_character":0,"end_line":1887,"end_character":66},"in_reply_to":"c4ddc3a9_7b4806ac","updated":"2021-03-09 11:33:47.000000000","message":"True. Moved to the preceding patch","commit_id":"47cf817bacc61361189aaa7171422bb94d80b0c8"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"569ab9e74b97d1d40ded14e73bc4609adef8eead","unresolved":false,"context_lines":[{"line_number":1964,"context_line":"    if policy is None:"},{"line_number":1965,"context_line":"        return None"},{"line_number":1966,"context_line":""},{"line_number":1967,"context_line":"    if policy not in fields.SecureBoot.ALL:"},{"line_number":1968,"context_line":"        msg \u003d _("},{"line_number":1969,"context_line":"            \u0027Invalid secure boot policy %(policy)r. Allowed values: %(valid)s.\u0027"},{"line_number":1970,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":4,"id":"ea2080ad_fa6f9e22","line":1967,"range":{"start_line":1967,"start_character":21,"end_line":1967,"end_character":42},"updated":"2021-03-04 17:32:04.000000000","message":"review note Id53f934fccb020dcc6bae9e13f53cbb3df3dcd92","commit_id":"47cf817bacc61361189aaa7171422bb94d80b0c8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ae6fcda80b67ee873efe9ff8d02fdaebb487c77e","unresolved":true,"context_lines":[{"line_number":1222,"context_line":"    flavor: \u0027objects.Flavor\u0027,"},{"line_number":1223,"context_line":"    image_meta: \u0027objects.ImageMeta\u0027,"},{"line_number":1224,"context_line":"    default: ty.Any \u003d None,"},{"line_number":1225,"context_line":"    prefix: str \u003d \u0027hw\u0027,"},{"line_number":1226,"context_line":") -\u003e ty.Any:"},{"line_number":1227,"context_line":"    \"\"\"A variant of \u0027_get_flavor_image_meta\u0027 that errors out on conflicts.\"\"\""},{"line_number":1228,"context_line":"    flavor_value, image_value \u003d _get_flavor_image_meta("}],"source_content_type":"text/x-python","patch_set":6,"id":"a5148219_e74c1f88","line":1225,"updated":"2021-03-09 10:38:19.000000000","message":"please, don\u0027t set a default parameter like this.\n\nprefix should be None by default and then, later when looking at the argument value, if None, set it to \u0027hw\u0027.\n\ntl;dr: that\u0027s because strings are mutable and you shouldn\u0027t default parameters with mutables.\nhttps://towardsdatascience.com/python-pitfall-mutable-default-arguments-9385e8265422","commit_id":"bc020efab3371b6ae7952dffe41f9f1247b385f1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"ead386dede1b12f75c86a494b0cfb842a2e41f78","unresolved":false,"context_lines":[{"line_number":1222,"context_line":"    flavor: \u0027objects.Flavor\u0027,"},{"line_number":1223,"context_line":"    image_meta: \u0027objects.ImageMeta\u0027,"},{"line_number":1224,"context_line":"    default: ty.Any \u003d None,"},{"line_number":1225,"context_line":"    prefix: str \u003d \u0027hw\u0027,"},{"line_number":1226,"context_line":") -\u003e ty.Any:"},{"line_number":1227,"context_line":"    \"\"\"A variant of \u0027_get_flavor_image_meta\u0027 that errors out on conflicts.\"\"\""},{"line_number":1228,"context_line":"    flavor_value, image_value \u003d _get_flavor_image_meta("}],"source_content_type":"text/x-python","patch_set":6,"id":"d58c2546_2e31ae79","line":1225,"in_reply_to":"053e2c6f_505f7aab","updated":"2021-03-09 11:33:47.000000000","message":"Yes, they\u0027re immutable. This is only an issue for mutable types like lists.\n\n  \u003e\u003e\u003e def foo(x\u003d[]):\n  ...     x.append(\u0027s\u0027)\n  ... \n  \u003e\u003e\u003e a \u003d []\n  \u003e\u003e\u003e foo(a)\n  \u003e\u003e\u003e a\n  [\u0027s\u0027]\n  \u003e\u003e\u003e foo(a)\n  \u003e\u003e\u003e a\n  [\u0027s\u0027, \u0027s\u0027]\n\nThe *vast* majority of the callers here use \u0027hw\u0027 namespace so I think a default parameter value of \u0027hw\u0027 is perfectly viable","commit_id":"bc020efab3371b6ae7952dffe41f9f1247b385f1"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"15551113972f2ba14c0cac143dab013af89c81b9","unresolved":true,"context_lines":[{"line_number":1222,"context_line":"    flavor: \u0027objects.Flavor\u0027,"},{"line_number":1223,"context_line":"    image_meta: \u0027objects.ImageMeta\u0027,"},{"line_number":1224,"context_line":"    default: ty.Any \u003d None,"},{"line_number":1225,"context_line":"    prefix: str \u003d \u0027hw\u0027,"},{"line_number":1226,"context_line":") -\u003e ty.Any:"},{"line_number":1227,"context_line":"    \"\"\"A variant of \u0027_get_flavor_image_meta\u0027 that errors out on conflicts.\"\"\""},{"line_number":1228,"context_line":"    flavor_value, image_value \u003d _get_flavor_image_meta("}],"source_content_type":"text/x-python","patch_set":6,"id":"053e2c6f_505f7aab","line":1225,"in_reply_to":"a5148219_e74c1f88","updated":"2021-03-09 11:20:00.000000000","message":"Apologies if I\u0027m getting this wrong but aren\u0027t strings immutable [1] and even if they were wouldn\u0027t this only be an issue if we were making changes to prefix as part of this method?\n\n[1] https://en.wikipedia.org/wiki/Immutable_object#Python","commit_id":"bc020efab3371b6ae7952dffe41f9f1247b385f1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8197c027ae2aff5e669c5b1324802a05d6544377","unresolved":false,"context_lines":[{"line_number":1222,"context_line":"    flavor: \u0027objects.Flavor\u0027,"},{"line_number":1223,"context_line":"    image_meta: \u0027objects.ImageMeta\u0027,"},{"line_number":1224,"context_line":"    default: ty.Any \u003d None,"},{"line_number":1225,"context_line":"    prefix: str \u003d \u0027hw\u0027,"},{"line_number":1226,"context_line":") -\u003e ty.Any:"},{"line_number":1227,"context_line":"    \"\"\"A variant of \u0027_get_flavor_image_meta\u0027 that errors out on conflicts.\"\"\""},{"line_number":1228,"context_line":"    flavor_value, image_value \u003d _get_flavor_image_meta("}],"source_content_type":"text/x-python","patch_set":6,"id":"7b740d16_783f01a3","line":1225,"in_reply_to":"d58c2546_2e31ae79","updated":"2021-03-09 14:04:17.000000000","message":"Shit, strings are indeed immutable so this is not an issue. Maybe just a concern about the pattern because people could copy/paste some methods without thinking whether the new arguments could be mutable. \nThat\u0027s why I prefer to just have default values to be None, honestly, but that being said, now it\u0027s a nit.","commit_id":"bc020efab3371b6ae7952dffe41f9f1247b385f1"}]}
