Sitelet https://web.archive.org/web/20200821023702/https://github.com/gnuradio/gnuradio/issues/3584
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

get rid of `from __future__ import stuff` #3584

Open
marcusmueller opened this issue Jun 20, 2020 · 0 comments
Open

get rid of `from __future__ import stuff` #3584

marcusmueller opened this issue Jun 20, 2020 · 0 comments

Comments

@marcusmueller
Copy link
Member

@marcusmueller marcusmueller commented Jun 20, 2020 •

unicode_literals was necessary pre-Python 2.6; absolute_import pre-2.5.

It's especially not necessary on Py3.

Hence in the sence of cleaning up the source tree, deletion of all from __future__ import something from the python files is desirable. This should ideally not happen manually, but with a script, or command line: we need to do that on master, but it might also be desirable to offer tooling to OOT developers.

Reference for the __future__ module: https://docs.python.org/3.6/library/__future__.html#module-__future__

(this issue should be reserved for beginners, I think. It's a good way to learn building GNU Radio, running tests, making a Pull Request.)

sashko added a commit to sashko/gnuradio that referenced this issue Jul 16, 2020
All of the removed `from __future__ import` were needed in older
versions of Python (mostly 2.5.x and below) but later became mandatory
in most versions of Python 3 hence are not necessary anymore.

More specifically, according to __future__.py[1]:
- unicode_literals is part of Python since versions 2.6.0 and 3.0.0;
- print_function is part of Python since versions 2.6.0 and 3.0.0;
- absolute_import is part of Python since versions 2.5.0 and 3.0.0;
- division is part of Python since versions 2.2.0 and 3.0.0;

Get rid of those unnecessary imports to slightly clean up the codebase.

Fixes gnuradio#3584.

[1] https://github.com/python/cpython/blob/master/Lib/__future__.py
sashko added a commit to sashko/gnuradio that referenced this issue Jul 16, 2020
All of the removed `from __future__ import` were needed in older
versions of Python (mostly 2.5.x and below) but later became mandatory
in most versions of Python 3 hence are not necessary anymore.

More specifically, according to __future__.py[1]:
- unicode_literals is part of Python since versions 2.6.0 and 3.0.0;
- print_function is part of Python since versions 2.6.0 and 3.0.0;
- absolute_import is part of Python since versions 2.5.0 and 3.0.0;
- division is part of Python since versions 2.2.0 and 3.0.0;

Get rid of those unnecessary imports to slightly clean up the codebase.

Fixes gnuradio#3584.

[1] https://github.com/python/cpython/blob/master/Lib/__future__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.