Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python 2 syntax in examples, why? #1091

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

Closed
matheusfelipeog opened this issue Jan 31, 2021 · 5 comments
Closed

Python 2 syntax in examples, why? #1091

matheusfelipeog opened this issue Jan 31, 2021 · 5 comments

Comments

@matheusfelipeog
Copy link
Contributor

Hi :)

Why use python 2 syntax in examples today? Since Python 2 has been discontinued in January 1, 2020.

Examples:

four_lists = [[] for __ in xrange(4)]

instead:

four_lists = [[] for __ in range(4)]

Has a note stating the new syntax:

Note: Use range() instead of xrange() in Python 3.

But is this really necessary today? Isn't it better to update everything to Python 3 syntax?

@matheusfelipeog
Copy link
Contributor Author

If allowed, I can update everything to Python 3 syntax ;)

@dbader
Copy link
Member

dbader commented Feb 2, 2021

@matheusfelipeog Agreed, I think it's time to switch the Guide over to Python 3 πŸ™‚

If allowed, I can update everything to Python 3 syntax ;)

Well, that'd be amazing. If you want to put together a pull-request (or a series of PRs we can merge one by one) to make some of these updates that'd be great.

@matheusfelipeog
Copy link
Contributor Author

Right πŸ˜†

I will start the update soon.

@matheusfelipeog
Copy link
Contributor Author

I updated everything I found πŸ˜„

I made a pull request per updated section

@dbader
Copy link
Member

dbader commented Feb 23, 2021

Cheers @matheusfelipeog, I just merged those PRs :) Nice work.

@dbader dbader closed this as completed Feb 23, 2021
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

2 participants