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

Define xrange() for Python 3 #60

Merged
merged 1 commit into from
Mar 12, 2018
Merged

Define xrange() for Python 3 #60

merged 1 commit into from
Mar 12, 2018

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Mar 12, 2018

xrange() is called 21 times in this file but it was removed from Python 3 in favor of range().

__xrange()__ is called 21 times in this file but it was removed from Python 3 in favor of __range()__.
@mikepurvis
Copy link
Member

Interesting situation. It seems the upstream version of this still has the problem you describe, so just bumping that doesn't do any good:

https://github.com/google/styleguide/blob/gh-pages/cpplint/cpplint.py

In the past my preference has been to monkey-patch cpplint so it's easier to periodically pull the new upstream version, but this isn't really a monkey-patchable change.

@mikepurvis mikepurvis merged commit 116a838 into ros:master Mar 12, 2018
@cclauss
Copy link
Contributor Author

cclauss commented Mar 12, 2018

Thanks Mike... I will try to push this change into upstream.

What is ROS' general position on migrating to Python 3? I could help out there but want to do so in ways that do not rub maintainers the wrong way. Reading thru upstream as you suggested, I came across https://github.com/google/styleguide/blob/cfce3c3a866cfa9ec12fff08d5e575ca875f787b/pyguide.md#the-six-future-or-past-libraries Does ROS have a POV on the use of six to achieve compatibility with both Python 2 and Python 3?

@mikepurvis
Copy link
Member

Everything in ros_base (which includes this repo) is theoretically bilingual. However, Python 3 is not the default Python on any current Ubuntu LTS, so OSRF hasn't got ongoing test coverage for Python 3, meaning there are frequent regressions.

In terms of larger policy around a migration plan, feel free to join the fray: ros-infrastructure/rep#149

@cclauss cclauss deleted the patch-1 branch March 12, 2018 14:53
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