)]}'
{"ironic/api/controllers/v1/types.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"ff4b010e6eccc2a4e01f275167b5145c10e5f038","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class MultiType(wtypes.UserType):"},{"line_number":170,"context_line":"    \"\"\"User type for validate that value has one of a few types.\"\"\""},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def __init__(self, *types):"},{"line_number":173,"context_line":"        self.types \u003d types"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F8%2FNE%3D","line":170,"updated":"2013-12-18 02:10:15.000000000","message":"Since you\u0027re making changes anyway, it would be nice to have a better description.\n\nEg \"MultiType represents zero or more types. Can be used for validating that a value is an instance of one of the types.\" Slightly better anyway. ;)\n\nI notice that StringType\u0027s docstring includes a description of the __init__() parameters. Is it worth doing that here?","commit_id":"c6881b05dd860c2a156e1f950e4a0ffb2f76baad"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"58d1899bffe077f93e80a3fb3f96eff4c29bf714","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class MultiType(wtypes.UserType):"},{"line_number":170,"context_line":"    \"\"\"User type for validate that value has one of a few types.\"\"\""},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def __init__(self, *types):"},{"line_number":173,"context_line":"        self.types \u003d types"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F8ySg%3D","line":170,"in_reply_to":"AAAATn%2F8%2FNE%3D","updated":"2013-12-20 10:28:43.000000000","message":"Ah good idea, and thanks for the suggestion as well :)","commit_id":"c6881b05dd860c2a156e1f950e4a0ffb2f76baad"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"c2b53342ff99804de799349b42c251607edd71a1","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class MultiType(wtypes.UserType):"},{"line_number":170,"context_line":"    \"\"\"User type for validate that value has one of a few types.\"\"\""},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def __init__(self, *types):"},{"line_number":173,"context_line":"        self.types \u003d types"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F8yOs%3D","line":170,"in_reply_to":"AAAATn%2F8ySg%3D","updated":"2013-12-20 10:45:39.000000000","message":"It can represent one or more types, zero types would make it goes to the \"else\" block of the for loop :)","commit_id":"c6881b05dd860c2a156e1f950e4a0ffb2f76baad"},{"author":{"_account_id":1726,"name":"Ghe Rivero","email":"ghe.rivero@gmail.com","username":"ghe.rivero"},"change_message_id":"2b19570dd74b1cd643a18cd12707cdb24d6bfb6c","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    def validate(self, value):"},{"line_number":181,"context_line":"        for t in self.types:"},{"line_number":182,"context_line":"            if t is wsme.types.text and isinstance(value, wsme.types.bytes):"},{"line_number":183,"context_line":"                value \u003d value.decode()"},{"line_number":184,"context_line":"            if isinstance(value, t):"},{"line_number":185,"context_line":"                return value"},{"line_number":186,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8yMA%3D","line":183,"updated":"2013-12-20 11:01:12.000000000","message":"Not related to this patch but, why validating a byte type change the return value to a str (In Python2 byte type is an str, so this doesn\u0027t matter, but in Python 3, this could lead to errors)","commit_id":"f8848e91e6525203e07121f6c56f3fd55e9f3c49"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"6ffa5e0f831ab06189a82f4b82c1c230518dc16d","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    def validate(self, value):"},{"line_number":181,"context_line":"        for t in self.types:"},{"line_number":182,"context_line":"            if t is wsme.types.text and isinstance(value, wsme.types.bytes):"},{"line_number":183,"context_line":"                value \u003d value.decode()"},{"line_number":184,"context_line":"            if isinstance(value, t):"},{"line_number":185,"context_line":"                return value"},{"line_number":186,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8yBo%3D","line":183,"in_reply_to":"AAAATn%2F8yMA%3D","updated":"2013-12-20 11:47:44.000000000","message":"Ghe, wsme.types.bytes is six.binary_type.\n\nPython 3.3.3 (default, Nov 19 2013, 16:43:19) \n\n\u003e\u003e\u003e b\u0027abc\u0027.decode()\n\n\u0027abc\u0027 \n\n^ unicode\n\nPython 2.7.3 (default, Sep 26 2013, 20:03:06)\n\n\u003e\u003e\u003e \u0027abc\u0027.decode()\n\nu\u0027abc\u0027\n\n^ same","commit_id":"f8848e91e6525203e07121f6c56f3fd55e9f3c49"}]}
