Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect changes on code using both iterkeys and next #206

Open
Han-He opened this issue Jul 2, 2020 · 0 comments
Open

Incorrect changes on code using both iterkeys and next #206

Han-He opened this issue Jul 2, 2020 · 0 comments

Comments

@Han-He
Copy link

Han-He commented Jul 2, 2020

➜ 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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant