Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upget rid of `from __future__ import stuff` #3584
Open
Labels
Comments
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
unicode_literalswas necessary pre-Python 2.6;absolute_importpre-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 somethingfrom the python files is desirable. This should ideally not happen manually, but with a script, or command line: we need to do that onmaster, 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.)