Skip to content

Make conversions of xrange()#10559

Closed
tropfcode wants to merge 4 commits into
matplotlib:masterfrom
tropfcode:master
Closed

Make conversions of xrange()#10559
tropfcode wants to merge 4 commits into
matplotlib:masterfrom
tropfcode:master

Conversation

@tropfcode

Copy link
Copy Markdown
Contributor

PR Summary

Remove imports of six.moves.xrange() and convert use of xrange() to range() or itertools.count() for Pythong3 compliance. This completes the first and third issues of #10556.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

…tring

Added RectangleSelector.geometry docstring
Remove import of xrange() and convert xrange() to range()
Import itertools and use itertools.count() to convert xrange() for Python3
@tropfcode

Copy link
Copy Markdown
Contributor Author

Will redo PR on different branch.

@tropfcode tropfcode closed this Feb 21, 2018
s_len = 0
# todo: use Alex's xrange pattern from the cbook for efficiency
for (word, ind) in zip(seq, xrange(len(seq))):
for (word, ind) in zip(seq, range(len(seq))):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should use enumerate instead.

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

Successfully merging this pull request may close these issues.

2 participants