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

Use py3 next() syntax #1159

Merged
merged 1 commit into from
Jul 5, 2022
Merged

Use py3 next() syntax #1159

merged 1 commit into from
Jul 5, 2022

Conversation

ptrblck
Copy link
Contributor

@ptrblck ptrblck commented Jul 2, 2022

Description

The example uses the Python 2 .next() syntax here:

    data = iter(training_dataloader)
    images, _ = data.next()

which will break if a PyTorch version after pytorch/pytorch#78594 is used as the compat assignment was removed.

According to PEP 3114 the new Python 3 syntax should be used:

out = next(iterator)

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @peri044 FYI in case there are other instances of this (maybe the calibrator implementations in python?)

@narendasan narendasan merged commit 45a57da into pytorch:master Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants