Skip to content

Incorrect changes on code using both iterkeys and next #206

Open
@Han-He

Description

@Han-He
➜ test python-modernize --version
modernize 0.7

after running python-modernize on test code

+from future import print_function
+import six
d = {"key": "value"}
-first_key = d.iterkeys().next()
+first_key = six.iterkeys(d)
print(first_key)

This is not equivalent and it should be changed to six.next(six.iterkeys(d))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions