New submission from Pranav Devarakonda <devarakondapra...@yahoo.com>:
fix_dict.py applies fixes to every instance of keys(), items() or values() irrespective of the type of object. Since 2to3 cannot check the type of the object, we can at least add the check to the generated code like... d.keys() -> list(d.keys) if type(d) == dict else d.keys() and similarly d.viewkeys() -> d.keys() if type(d) == dict else d.viewkeys() PFA the tweaked fixer. ---------- components: 2to3 (2.x to 3.x conversion tool) files: fix_dict.py messages: 327682 nosy: benjamin.peterson, devarakondapranav priority: normal severity: normal status: open title: check type of object in fix_dict.py in 2to3 type: enhancement Added file: https://bugs.python.org/file47866/fix_dict.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34978> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com