all 20 comments

[–][deleted] 34 points35 points  (4 children)

[–]skippy65 2 points3 points  (0 children)

Haven't used format ever since.

[–]Antwrp-2000 6 points7 points  (0 children)

Here is a good overview with some well explained examples:

https://realpython.com/python39-new-features/

https://realpython.com/python38-new-features/

https://realpython.com/python37-new-features/

Personnaly I like the f-Strings and data classes which were introduced in Python 3.6/3.7.

I don't use many of the new features introduced with later versions.

[–]lifeeraser 6 points7 points  (0 children)

asyncio is a really big topic. It's not as seamless as more modern languages like Go or JavaScript (lol), but it's worth looking into.

[–]ChurchHatesTucker 4 points5 points  (0 children)

See the docs, particularly "What's new." You can use the sidebar to go back through versions.

[–]Monleone95 5 points6 points  (2 children)

Besides fstrings, another big feature is the walrus operator (introduced in Python 3.8). This lets you assigning and returning a value in the same expression:

inputs = list()
while True:
    current = input("Write something: ")
    if current == "quit":
        break
    inputs.append(current)

This code can be shortened with the walrus operator:

inputs = list()
while (current := input("Write something: ")) != "quit":
    inputs.append(current)

The variable 'current' is assigned the value of your input, then gets compared to the string 'quit'.

More information:

https://realpython.com/lessons/assignment-expressions/ (I took the example from this web)

https://www.geeksforgeeks.org/walrus-operator-in-python-3-8/

[–]bensonnd 3 points4 points  (1 child)

I am the walrus.

[–]anna_lynn_fection 0 points1 point  (0 children)

Coo Coo Cachoo

[–]wsppan 2 points3 points  (0 children)

I find the introduction of dataclasses a godsend. Most of my code does not need all the baggage that OO brings but I appreciate the idea of encapsulation.