)]}'
{"taskflow/task.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"329755e124aaf71494d9ea830c1c4bb98cc90389","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                    isinstance(obj, collections.Iterable))"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class ReduceFunctorTask(BaseTask):"},{"line_number":252,"context_line":"    \"\"\"General purpose Task to reduce a list by applying a function"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    This Task mimics the behavior of Python\u0027s built-in reduce function.  The"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_7ef38e0a","line":251,"updated":"2015-02-20 06:49:35.000000000","message":"Any reason this couldn\u0027t just derive from ``FunctorTask`` instead? Seems pretty similar; u can still override the execute() method with your own and share the common parts?","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ebf60702d7d118617e1e6f1da56e3cc70f0bcaa9","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                    isinstance(obj, collections.Iterable))"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class ReduceFunctorTask(BaseTask):"},{"line_number":252,"context_line":"    \"\"\"General purpose Task to reduce a list by applying a function"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    This Task mimics the behavior of Python\u0027s built-in reduce function.  The"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_fe4dbec5","line":251,"in_reply_to":"ba7be1f8_7ef38e0a","updated":"2015-02-20 07:20:01.000000000","message":"I think the key reason this won\u0027t work is because of argument mapping.  If Map and Reduce were subclassed to FunctorTask, the functor\u0027s arguments would be interpolated when arguments are mapped.  In order to avoid this, we would be calling the superclass constructor with auto_extract\u003dFalse, then calling build_arg_mapping again, or call the superclass constructor with execute\u003dself.execute, which then has self.execute being assigned to _execute...  It seems cleaner to me to duplicate the 2 pieces in common (deriving the name if it\u0027s not provided, and calling build_arg_mapping) rather than subclassing.","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"fc147a5fc334aaea9a300ef122ac5b0e5820445b","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                    isinstance(obj, collections.Iterable))"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"class ReduceFunctorTask(BaseTask):"},{"line_number":252,"context_line":"    \"\"\"General purpose Task to reduce a list by applying a function"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    This Task mimics the behavior of Python\u0027s built-in reduce function.  The"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_077314ea","line":251,"in_reply_to":"ba7be1f8_fe4dbec5","updated":"2015-02-20 16:41:26.000000000","message":"Ok dokie.","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"329755e124aaf71494d9ea830c1c4bb98cc90389","unresolved":false,"context_lines":[{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":268,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":269,"context_line":"            raise ValueError(\"functor must take exactly 2 arguments\")"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not _is_iterable(requires):"},{"line_number":272,"context_line":"            raise TypeError(\"requires must be an iterable type\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_bec34689","line":269,"updated":"2015-02-20 06:49:35.000000000","message":"Might be nice be consistent with the exception wording.\n\nPerhaps the following instead.\n\n \"Reduce functor must take exactly 2 arguments instead of taking %s arguments\" % len(f_args)\n\nSeem ok?","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ebf60702d7d118617e1e6f1da56e3cc70f0bcaa9","unresolved":false,"context_lines":[{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":268,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":269,"context_line":"            raise ValueError(\"functor must take exactly 2 arguments\")"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not _is_iterable(requires):"},{"line_number":272,"context_line":"            raise TypeError(\"requires must be an iterable type\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_1e4b72b1","line":269,"in_reply_to":"ba7be1f8_bec34689","updated":"2015-02-20 07:20:01.000000000","message":"Done","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"329755e124aaf71494d9ea830c1c4bb98cc90389","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":269,"context_line":"            raise ValueError(\"functor must take exactly 2 arguments\")"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not _is_iterable(requires):"},{"line_number":272,"context_line":"            raise TypeError(\"requires must be an iterable type\")"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        if len(requires) \u003c 2:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_de3d5abd","line":271,"updated":"2015-02-20 06:49:35.000000000","message":"Would this be better just checking something like the following:\n\n  if not isinstance(requires, (list, tuple, set)):\n     raise TypeError ...\n\nSince I\u0027m not sure if this works as u want it if a custom iterator is provided here. What do u think?","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"0f5a24194a2b5daa2da3bb0e3608e9834590d839","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":269,"context_line":"            raise ValueError(\"functor must take exactly 2 arguments\")"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not _is_iterable(requires):"},{"line_number":272,"context_line":"            raise TypeError(\"requires must be an iterable type\")"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        if len(requires) \u003c 2:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_10d6d64f","line":271,"in_reply_to":"ba7be1f8_3ec75614","updated":"2015-02-21 04:32:12.000000000","message":"Had to revert this, python 3 returns Iterable types rather than a list for some builtins like dict.keys()","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ebf60702d7d118617e1e6f1da56e3cc70f0bcaa9","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":269,"context_line":"            raise ValueError(\"functor must take exactly 2 arguments\")"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"        if not _is_iterable(requires):"},{"line_number":272,"context_line":"            raise TypeError(\"requires must be an iterable type\")"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"        if len(requires) \u003c 2:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_3ec75614","line":271,"in_reply_to":"ba7be1f8_de3d5abd","updated":"2015-02-20 07:20:01.000000000","message":"Done","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"329755e124aaf71494d9ea830c1c4bb98cc90389","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        return reduce(self._functor, l)"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"class MapFunctorTask(BaseTask):"},{"line_number":293,"context_line":"    \"\"\"General purpose Task to map a function to a list"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    This Task mimics the behavior of Python\u0027s built-in map function.  The Task"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_be4a6625","line":292,"updated":"2015-02-20 06:49:35.000000000","message":"Same question I guess for this one and using \u0027\u0027FunctorTask\u0027\u0027","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ebf60702d7d118617e1e6f1da56e3cc70f0bcaa9","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        return reduce(self._functor, l)"},{"line_number":290,"context_line":""},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"class MapFunctorTask(BaseTask):"},{"line_number":293,"context_line":"    \"\"\"General purpose Task to map a function to a list"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    This Task mimics the behavior of Python\u0027s built-in map function.  The Task"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_9ed682c4","line":292,"in_reply_to":"ba7be1f8_be4a6625","updated":"2015-02-20 07:20:01.000000000","message":"see response above","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"329755e124aaf71494d9ea830c1c4bb98cc90389","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":313,"context_line":"        if len(f_args) !\u003d 1:"},{"line_number":314,"context_line":"            raise ValueError(\"functor must take exactly 1 argument\")"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        if not _is_iterable(requires):"},{"line_number":317,"context_line":"            raise TypeError(\"requires must be an iterable type\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_5e0a4ad3","line":314,"updated":"2015-02-20 06:49:35.000000000","message":"Similar kind of exception message adjustment would be cool.","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ebf60702d7d118617e1e6f1da56e3cc70f0bcaa9","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":313,"context_line":"        if len(f_args) !\u003d 1:"},{"line_number":314,"context_line":"            raise ValueError(\"functor must take exactly 1 argument\")"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        if not _is_iterable(requires):"},{"line_number":317,"context_line":"            raise TypeError(\"requires must be an iterable type\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_ded71abe","line":314,"in_reply_to":"ba7be1f8_5e0a4ad3","updated":"2015-02-20 07:20:01.000000000","message":"Done","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"329755e124aaf71494d9ea830c1c4bb98cc90389","unresolved":false,"context_lines":[{"line_number":314,"context_line":"            raise ValueError(\"functor must take exactly 1 argument\")"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        if not _is_iterable(requires):"},{"line_number":317,"context_line":"            raise TypeError(\"requires must be an iterable type\")"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"        if name is None:"},{"line_number":320,"context_line":"            name \u003d reflection.get_callable_name(functor)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_de6e3a96","line":317,"updated":"2015-02-20 06:49:35.000000000","message":"Same question, maybe just enforce its a list, or tuple?","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ebf60702d7d118617e1e6f1da56e3cc70f0bcaa9","unresolved":false,"context_lines":[{"line_number":314,"context_line":"            raise ValueError(\"functor must take exactly 1 argument\")"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        if not _is_iterable(requires):"},{"line_number":317,"context_line":"            raise TypeError(\"requires must be an iterable type\")"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"        if name is None:"},{"line_number":320,"context_line":"            name \u003d reflection.get_callable_name(functor)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_fee4dead","line":317,"in_reply_to":"ba7be1f8_de6e3a96","updated":"2015-02-20 07:20:01.000000000","message":"Done","commit_id":"8999a34413954eed2533f941d51ffca7c1fde9ea"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2c2f9673c3386658f806d77d8402e35e373ba800","unresolved":false,"context_lines":[{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":257,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":258,"context_line":"            raise ValueError(\"Reduce functor must take exactly 2 arguments, \""},{"line_number":259,"context_line":"                             \"%s arguments were provided\" % len(f_args))"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        if not isinstance(requires, (list, tuple, set)):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_2a961f95","line":258,"updated":"2015-02-20 16:45:52.000000000","message":"Same question as below I  guess.","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"c29fabef6f384d6528a0253704f34d7bcb8adffa","unresolved":false,"context_lines":[{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":257,"context_line":"        if len(f_args) !\u003d 2:"},{"line_number":258,"context_line":"            raise ValueError(\"Reduce functor must take exactly 2 arguments, \""},{"line_number":259,"context_line":"                             \"%s arguments were provided\" % len(f_args))"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"        if not isinstance(requires, (list, tuple, set)):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_b0550ac8","line":258,"in_reply_to":"ba7be1f8_2a961f95","updated":"2015-02-21 04:44:45.000000000","message":"Done","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"67f50d86167df8ac25adf270933e7a23adfb78de","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                 auto_extract\u003dTrue, rebind\u003dNone, inject\u003dNone):"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        if not six.callable(functor):"},{"line_number":300,"context_line":"            raise ValueError(\"Function to use for reduce must be\""},{"line_number":301,"context_line":"                             \" callable\")"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_872c64ad","line":300,"updated":"2015-02-20 16:43:39.000000000","message":"\"Function to use for map must be callable\"?","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"6247ac706819d732f9a4c6837e87964fb16a2e27","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                 auto_extract\u003dTrue, rebind\u003dNone, inject\u003dNone):"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        if not six.callable(functor):"},{"line_number":300,"context_line":"            raise ValueError(\"Function to use for reduce must be\""},{"line_number":301,"context_line":"                             \" callable\")"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_706d5232","line":300,"in_reply_to":"ba7be1f8_704b922b","updated":"2015-02-21 05:57:39.000000000","message":"Oh; i meant the wording should be different, not the check :)","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"1ac06b0be6e4b65e94510b7982639b487d2f529b","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                 auto_extract\u003dTrue, rebind\u003dNone, inject\u003dNone):"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        if not six.callable(functor):"},{"line_number":300,"context_line":"            raise ValueError(\"Function to use for reduce must be\""},{"line_number":301,"context_line":"                             \" callable\")"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_625f1342","line":300,"in_reply_to":"ba7be1f8_706d5232","updated":"2015-02-24 01:02:19.000000000","message":"Reworded to \"Map functor must be callable\"","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"c29fabef6f384d6528a0253704f34d7bcb8adffa","unresolved":false,"context_lines":[{"line_number":297,"context_line":"                 auto_extract\u003dTrue, rebind\u003dNone, inject\u003dNone):"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        if not six.callable(functor):"},{"line_number":300,"context_line":"            raise ValueError(\"Function to use for reduce must be\""},{"line_number":301,"context_line":"                             \" callable\")"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_704b922b","line":300,"in_reply_to":"ba7be1f8_872c64ad","updated":"2015-02-21 04:44:45.000000000","message":"doesn\u0027t it?  I thought all functions/functors had to have the callable property to be used as a functor in operations like map or reduce","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"eb9d84a3c0aae4ef7f013b6807abaa288f8d5a15","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":304,"context_line":"        if len(f_args) !\u003d 1:"},{"line_number":305,"context_line":"            raise ValueError(\"Map functor must take exactly 1 argument, \""},{"line_number":306,"context_line":"                             \"%s arguments were provided\" % len(f_args))"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        if not isinstance(requires, (list, tuple, set)):"},{"line_number":309,"context_line":"            raise TypeError(\"Requires must be a list, tuple, or set\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_8a5f0b0e","line":306,"updated":"2015-02-20 16:45:03.000000000","message":"\"%s arguments were provided\" -\u003e \"%s arguments are required\" (since at this point nothing has been provided and u are just stating how many arguments are required to call this functor at some point in the future).","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"c29fabef6f384d6528a0253704f34d7bcb8adffa","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":304,"context_line":"        if len(f_args) !\u003d 1:"},{"line_number":305,"context_line":"            raise ValueError(\"Map functor must take exactly 1 argument, \""},{"line_number":306,"context_line":"                             \"%s arguments were provided\" % len(f_args))"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        if not isinstance(requires, (list, tuple, set)):"},{"line_number":309,"context_line":"            raise TypeError(\"Requires must be a list, tuple, or set\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba7be1f8_9048062f","line":306,"in_reply_to":"ba7be1f8_8a5f0b0e","updated":"2015-02-21 04:44:45.000000000","message":"Done","commit_id":"be5b8e019d10cca610eafb1858665298e466fafe"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"cf0269105e3e565e2eaf87b442e54c011023958a","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            return None"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"# TODO(sputnik13): it might be good to get an is_iterable check in oslo_utils"},{"line_number":241,"context_line":"if six.PY2:"},{"line_number":242,"context_line":"    def _is_iterable(obj):"},{"line_number":243,"context_line":"        return hasattr(obj, \u0027__iter__\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_d0aa7e6f","line":240,"updated":"2015-02-21 05:30:00.000000000","message":"I agree :)\n\nIn the meantime how about putting this into utils/misc.py as a new is_iterable() function?","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"8dd1634e9c1a1c2f963a4f0516473daed0a191d8","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            return None"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"# TODO(sputnik13): it might be good to get an is_iterable check in oslo_utils"},{"line_number":241,"context_line":"if six.PY2:"},{"line_number":242,"context_line":"    def _is_iterable(obj):"},{"line_number":243,"context_line":"        return hasattr(obj, \u0027__iter__\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_bd192c7b","line":240,"in_reply_to":"ba7be1f8_d0aa7e6f","updated":"2015-02-24 01:12:22.000000000","message":"Done","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"cf0269105e3e565e2eaf87b442e54c011023958a","unresolved":false,"context_lines":[{"line_number":245,"context_line":"elif six.PY3:"},{"line_number":246,"context_line":"    import collections"},{"line_number":247,"context_line":"    import functools"},{"line_number":248,"context_line":"    reduce \u003d functools.reduce"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    def _is_iterable(obj):"},{"line_number":251,"context_line":"        return not (isinstance(obj, str) and"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_50b68eda","line":248,"updated":"2015-02-21 05:30:00.000000000","message":"I think u can use the following to get at the right version\n\nOn python 2.x\n\n  \u003e\u003e\u003e from six.moves import reduce as compat_reduce\n  \u003e\u003e\u003e compat_reduce\n  \u003cbuilt-in function reduce\u003e\n\nOn python 3.x\n\n  \u003e\u003e\u003e from six.moves import reduce as compat_reduce\n  \u003e\u003e\u003e compat_reduce\n  \u003cbuilt-in function reduce\u003e\n\nI think that\u0027s likely better than using the functools one (and follows the pattern that we already have of using six.moves to find the best location of the modules that have shifted around).","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"8dd1634e9c1a1c2f963a4f0516473daed0a191d8","unresolved":false,"context_lines":[{"line_number":245,"context_line":"elif six.PY3:"},{"line_number":246,"context_line":"    import collections"},{"line_number":247,"context_line":"    import functools"},{"line_number":248,"context_line":"    reduce \u003d functools.reduce"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    def _is_iterable(obj):"},{"line_number":251,"context_line":"        return not (isinstance(obj, str) and"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_9dbaa821","line":248,"in_reply_to":"ba7be1f8_50b68eda","updated":"2015-02-24 01:12:22.000000000","message":"Done","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"211855bbf3275f4eaa31a7376e7e6fc6652b9770","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                 auto_extract\u003dTrue, rebind\u003dNone, inject\u003dNone):"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        if not six.callable(functor):"},{"line_number":316,"context_line":"            raise ValueError(\"Function to use for reduce must be\""},{"line_number":317,"context_line":"                             \" callable\")"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_f07942fd","line":316,"updated":"2015-02-21 05:56:57.000000000","message":"\"Function to use for reduce must be callable\" -\u003e \"Function to use for map must be callable\"","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"8dd1634e9c1a1c2f963a4f0516473daed0a191d8","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                 auto_extract\u003dTrue, rebind\u003dNone, inject\u003dNone):"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        if not six.callable(functor):"},{"line_number":316,"context_line":"            raise ValueError(\"Function to use for reduce must be\""},{"line_number":317,"context_line":"                             \" callable\")"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_9dbf08fb","line":316,"in_reply_to":"ba7be1f8_f07942fd","updated":"2015-02-24 01:12:22.000000000","message":"Done","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"211855bbf3275f4eaa31a7376e7e6fc6652b9770","unresolved":false,"context_lines":[{"line_number":318,"context_line":""},{"line_number":319,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":320,"context_line":"        if len(f_args) !\u003d 1:"},{"line_number":321,"context_line":"            raise ValueError(\"%s arguments were provided.  Map functor must \""},{"line_number":322,"context_line":"                             \"take exactly 1 argument.\" % len(f_args))"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        if not _is_iterable(requires):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_107fb6e1","line":321,"updated":"2015-02-21 05:56:57.000000000","message":"How about one space after the period instead of two :)","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"8dd1634e9c1a1c2f963a4f0516473daed0a191d8","unresolved":false,"context_lines":[{"line_number":318,"context_line":""},{"line_number":319,"context_line":"        f_args \u003d reflection.get_callable_args(functor)"},{"line_number":320,"context_line":"        if len(f_args) !\u003d 1:"},{"line_number":321,"context_line":"            raise ValueError(\"%s arguments were provided.  Map functor must \""},{"line_number":322,"context_line":"                             \"take exactly 1 argument.\" % len(f_args))"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        if not _is_iterable(requires):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_5d4cb042","line":321,"in_reply_to":"ba7be1f8_107fb6e1","updated":"2015-02-24 01:12:22.000000000","message":"Done","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"211855bbf3275f4eaa31a7376e7e6fc6652b9770","unresolved":false,"context_lines":[{"line_number":322,"context_line":"                             \"take exactly 1 argument.\" % len(f_args))"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        if not _is_iterable(requires):"},{"line_number":325,"context_line":"            raise TypeError(\"%s type was provided for requires.  Requires \""},{"line_number":326,"context_line":"                            \"must be an iterable.\" % type(requires))"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        if name is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_3084bad3","line":325,"updated":"2015-02-21 05:56:57.000000000","message":"Same double space after period :)","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"8dd1634e9c1a1c2f963a4f0516473daed0a191d8","unresolved":false,"context_lines":[{"line_number":322,"context_line":"                             \"take exactly 1 argument.\" % len(f_args))"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        if not _is_iterable(requires):"},{"line_number":325,"context_line":"            raise TypeError(\"%s type was provided for requires.  Requires \""},{"line_number":326,"context_line":"                            \"must be an iterable.\" % type(requires))"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        if name is None:"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_7d47b41d","line":325,"in_reply_to":"ba7be1f8_3084bad3","updated":"2015-02-24 01:12:22.000000000","message":"Done","commit_id":"bdb4a406455faf4250045679ab790623e4ea7a30"}],"taskflow/utils/misc.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"0e937b6c0e35a5ffbfc3b7a7a904f61433bad3c1","unresolved":false,"context_lines":[{"line_number":479,"context_line":"    def is_iterable(obj):"},{"line_number":480,"context_line":"        return hasattr(obj, \u0027__iter__\u0027)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"elif six.PY3:"},{"line_number":483,"context_line":"    import collections"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def is_iterable(obj):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_e786ae64","line":482,"updated":"2015-02-24 04:54:12.000000000","message":"Why not just prefer this logic in the first place. On python 2.6 it seems to work as expected, seems like this same thing under the PY3 section should work for PY2 and PY3 (and u can just remove the PY2 section above)?\n\nhttp://paste.ubuntu.com/10383004/ has the test that I was using; seems to work right under PY2 I think?","commit_id":"76e3cfbbcf2e7b78566c0f4550640c87905694da"},{"author":{"_account_id":10584,"name":"Min Pae","username":"sputnik13","inactive":true},"change_message_id":"ca836ce3b259f0c0113c4b0f72475ac14db9072c","unresolved":false,"context_lines":[{"line_number":479,"context_line":"    def is_iterable(obj):"},{"line_number":480,"context_line":"        return hasattr(obj, \u0027__iter__\u0027)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"elif six.PY3:"},{"line_number":483,"context_line":"    import collections"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def is_iterable(obj):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_3d4c279e","line":482,"in_reply_to":"ba7be1f8_e786ae64","updated":"2015-02-25 01:31:20.000000000","message":"Done","commit_id":"76e3cfbbcf2e7b78566c0f4550640c87905694da"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"3f054f5f72a17d2616fb25c25ec3e97c45e3faa0","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        yield failure.Failure(exc_info\u003dexc_info)"},{"line_number":494,"context_line":""},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"def is_iterable(obj):"},{"line_number":497,"context_line":"    return not (isinstance(obj, str) and"},{"line_number":498,"context_line":"                isinstance(obj, collections.Iterable))"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_27c0714f","line":496,"updated":"2015-03-04 00:45:16.000000000","message":"Hmmm, think I found an issue here.\n\nSomething seems off here...\n\n  \u003e\u003e\u003e def is_iterable(obj):\n  ...   return not (isinstance(obj, str) and\n  ...               isinstance(obj, collections.Iterable))\n  ... \n  \u003e\u003e\u003e import collections\n  \u003e\u003e\u003e is_iterable(1)\n  True\n  \u003e\u003e\u003e is_iterable(object())\n  True","commit_id":"bafcf2d098e1ed472f08fc9bc452436aec0c57ca"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"6232641be28ca7d587beaa77746a985db4488484","unresolved":false,"context_lines":[{"line_number":493,"context_line":"        yield failure.Failure(exc_info\u003dexc_info)"},{"line_number":494,"context_line":""},{"line_number":495,"context_line":""},{"line_number":496,"context_line":"def is_iterable(obj):"},{"line_number":497,"context_line":"    return not (isinstance(obj, str) and"},{"line_number":498,"context_line":"                isinstance(obj, collections.Iterable))"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_27a791be","line":496,"in_reply_to":"ba7be1f8_27c0714f","updated":"2015-03-04 00:46:13.000000000","message":"Maybe also add some tests for this to taskflow/tests/unit/test_utils.py (to make sure it continues to work as expected).","commit_id":"bafcf2d098e1ed472f08fc9bc452436aec0c57ca"}]}
