This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author devarakondapranav
Recipients benjamin.peterson, devarakondapranav
Date 2018-10-14.00:05:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539475549.65.0.788709270274.issue34978@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-10-14 00:05:49devarakondapranavsetrecipients: + devarakondapranav, benjamin.peterson
2018-10-14 00:05:49devarakondapranavsetmessageid: <1539475549.65.0.788709270274.issue34978@psf.upfronthosting.co.za>
2018-10-14 00:05:49devarakondapranavlinkissue34978 messages
2018-10-14 00:05:48devarakondapranavcreate