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

Drop support for Python 3.5 #828

Closed
Kirill888 opened this issue Dec 5, 2019 · 3 comments
Closed

Drop support for Python 3.5 #828

Kirill888 opened this issue Dec 5, 2019 · 3 comments

Comments

@Kirill888
Copy link
Member

Python 3.5 is now 5 years old, it is no longer being developed. There are no plans to make new releases past 3.5.9 that came out last month.

Some prominent Python libraries are starting to drop support for Python 3.5 (Django 3 for example).

Version of python3 on current stable Ubuntu is 3.6.9.

There are a number of annoying differences between Python 3.5 and newer Python3.6. Mostly to do with pathlib.Path, those often come up in unit tests.

There are some places in the code that are special cased for python 3.5 (to do with unicode handling). For example here:

def load_from_json(handle):
if PY35:
data = handle.read().decode('utf8')
yield json.loads(data)
else:
yield json.load(handle)

Switching to 3.6+ only would also allow use of "f-Strings":

print(f"Value {x} is no good")         # 3.6+
print("Value {} is no good".format(x)) # 3.5

Other important features that are only available in newer version of Python include

  • Underscores in numeric constants 1_000_000 vs 1000000, code readability
  • Syntax for variable type annotations, becoming more important as we are adding mypy annotations to functions and methods
  • Some async improvements that we do not have current use for
@snowman2
Copy link
Contributor

snowman2 commented Dec 5, 2019

Also related:
pydata/xarray#3358

@Kirill888
Copy link
Member Author

Thanks @snowman2 very useful links that I could not find yesterday. If numpy and xarray are planning on dropping 3.5 "very soon" then that makes our choice much easier.

@omad
Copy link
Member

omad commented Dec 9, 2019

Awesome. That means I can start using f-strings all over the place! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants