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

Use .format() instead of f-strings #284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DimitriPapadopoulos
Copy link
Contributor

For compatibiliy with Python < 3.6

Fixes #270.

For compatibiliy with Python < 3.6
@Kangie
Copy link

Kangie commented Jan 31, 2024

I'd really prefer it if this was not merged. Python 3.6 was released 7 years ago. It went EoL just over two years ago. Python 3.5 went EOL nearly three and a half years ago.

If you are stuck using crusty old EoL python in 2023/2024 you really need to think about how to fix that, and not make everyone's scripts slower and harder to read. Please.

@DimitriPapadopoulos
Copy link
Contributor Author

Some Long Term Support Linux distributions that are not yet fully EOL'ed (under paid commercial support) may still ship EOL'ed Python versions. But then you might rightly argue that's the vendor's problem, and that such long term support contracts are for servers, not laptops...

  • RHEL 6 → Python 2.6 (Extended Life Cycle Support (ELS))
  • RHEL 7 → Python 2.7
  • RHEL 7.7 → Python 2.7 / 3.6
  • RHEL 8 → Python 3.6
  • Ubuntu 14.04 → Python 2.7 / 3.5 (Expanded Security Maintenance (ESM))
  • Ubuntu 16.04 → Python 2.7 / 3.5 (Expanded Security Maintenance (ESM))
  • Ubuntu 18.04 → Python 3.6 (Expanded Security Maintenance (ESM))
  • Ubuntu 20.04 → Python 3.6
  • Ubuntu 22.04 → Python 3.10

It looks like support for Python ≥ 3.6 remains currently unavoidable, but dropping support for Python < 3.6 looks reasonable indeed. To conclude, on one hand this is a minor change, on the other hand its purpose is support of an obsolete version that CI runners do not even test.

Alternatively, drop support for Python 3.5 and change all format() and classical string interpolation to f-strings everywhere.

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented Jan 31, 2024

I am curious what sort of machine ships Python < 3.6. Perhaps an old Apple laptop?

I cannot find a table showing the default Python version bundled with past macOS versions. According to Apple default python, Python3 was never packaged with macOS:

When Apple stopped including Python2 with macOS 12.3 [...]. Python3 was never packaged with macOS [...]

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.

Linux script uses formatted string literals only present since Python 3.6
2 participants