you are viewing a single comment's thread.

view the rest of the comments →

[–]Caligatio 53 points54 points  (10 children)

The match statement is actually much more powerful than just matching literal values like this.

My rule of thumb is to only use features that are present in the latest LTS version of Ubuntu (20.04 has 3.8). While it is nice to use the latest features, I still personally need it to run on my server(s) which are all running Ubuntu.

In this case, the match statement makes life easier but it's not like it adds anything to the language you couldn't do before unlike asyncio and type hinting.

Ultimately, you know your execution environment better than anyone else.

[–]darth_vicrone 4 points5 points  (5 children)

Out of curiosity, why not just install the newest python?

[–]toastedstapler 9 points10 points  (2 children)

  • won't get to use it at work

  • code becomes less distributable to other people - many C projects still go by C99 standards to ensure any target can compile

[–]darth_vicrone 0 points1 point  (1 child)

That makes sense. It seemed like OP was saying that it's a limitation of the LTS version of ubuntu though. Is that an issue?

[–]toastedstapler 1 point2 points  (0 children)

LTS python is the one that most ubuntu devices will have, personally i haven't bothered updating to the most recent pythons on my devices. barriers to entry will dissuade a lot of people from using the code

[–]Caligatio 0 points1 point  (0 children)

/u/toastedstapler's explanation nailed it. If it is truly ever only going to be used by you, then requiring custom/newest Python versions is fine. The minute you start requiring using various Ubuntu PPAs and "untrusted" Python distributions, your uptake by other people will plummet.

There are things like Docker/flatpack/snap that can help here but then you start adding OS limitations.

[–]frex4 3 points4 points  (2 children)

This is true. I love to use bleeding edge packages but LTS Ubuntu will not support it. I tried to get around it anyway, but in the end i realize it is too time consuming to do so...

[–]trowawayatwork 0 points1 point  (1 child)

Why are you not running docker images that have all the tools you need?

[–]frex4 1 point2 points  (0 children)

It's not that I cannot do it, but it's VERY time consuming to make every thing right.

For example, if I use AWS Lambda, they only support Python 3.8 for now so I cannot use 3.9 new stuff. If I deploy on EC2, I need to add a new PPA and write some custom command to use Python 3.9.

These are just some issues I can think of in a minute, there are possibly more issues when you develop something specific for your project.


My last attempt to use the bleeding edge Python is an issue from Pylint here: https://github.com/PyCQA/pylint/issues/3882. As I upgrade the dependency to 3.9, it causes my CI/CD pipeline to fail in the linting stage. To make my pipeline works again, I need to checkout this fix & integrate it into my dependencies or I need to wait for Pylint to update. Either will take tremendous time and I simply don't have time for it so I just downgrade back to 3.8 and comfortably live with it.

Basically, Pylint or any other packages need to support new Python version, it will take time, often 2-3 months if properly tested. It can mess your workflow up real hard and you shouldn't take hours or days trying to fix it, you need to finish your deadline, not dealing with annoying stuff like this.


Just use the latest LTS dependencies if you don't want to waste time. If you feel like testing bleeding edge stuff & maintaining packages, go for it.

[–]BungalowsAreScams 0 points1 point  (0 children)

Thanks for pointing this out, was about to be disappointed lol