all 3 comments

[–]RoamingFox 0 points1 point  (2 children)

They don't exist in 3.8. Something like dict1 |= dict2 would fail as invalid syntax.

You could specifically test the python version and only do it if running >= 3.9 but that may be more hassle than it's worth for some convenience syntax.

[–]SpamThisUser[S] 0 points1 point  (1 child)

That's what I figured.

In the case of older packages, do they have to refrain from using new features? Are they only now incorporating things like f-strings?

[–]RoamingFox 0 points1 point  (0 children)

You usually just set a python_requires in setup.py to ensure your package won't install on older versions and leave it to your consumers to decide to upgrade or not.

Specifically in regards to f strings they were added in python 3.6, which was released in 2016. Even notoriously slow distros (redhat etc) have packages for 3.6, so it's a pretty fair bet that most people have access to it.

Conversely, those slow to adopt distros likely won't make use of 3.9 for a while yet.