Python has multiple solutions for asynchronous programming - each with its own strengths and weakness. In many cases, people reach for a much more complicated solution than is actually needed forgetting the simple pool executors in the batteries-included concurrent futures library. Guidance is needed in this area so people avoid over-engineering and unnecessary complexity.
The core goal of the When of Python is to simplify the language so it is as elegant as possible and fits within our brain. The challenge is that, as Python continues to grow in popularity, the language will end up being used in almost every imaginable situation. In which case there will need to be lots of simplifying constructs specific to each situation. As Christopher Neugebauer pointed out in his Kiwi Pycon talk "The Complexity of Simplicity", there will always be complexity so the only question is where it gets handled. Either Python requires users to build complex tools out of simple components, or it provides simple constructs that fit specific situations e.g. for matrix multiplication, or for asynchronous processing. So to stay simple, the Python ecosystem will need to become more complex. Or, to put it another way, situational simplicity means more Python. Having said that, the core language can stay simple and we should keep trying to slim down and refine Common Python.
Adding struct to Python is tempting because structs would be better than dataclasses in particular ways. But they would be Yet Another Thing To Learn and Teach. And they aren't worth it in the core language. It is like cluttering up your kitchen with unitasker gadgets like meat claws and egg cubers.
Passing data around can easily become confusing. Dataclasses are a fantastic way of structuring and documenting our data and we should be using them a lot more. They are the only standard keyword-based data structure which can serve both our immutable and our mutable data needs. Maybe we should stop teaching collections.namedtuple and typing.NamedTuple and focus on making dataclasses.dataclasses as idiomatic, familiar, and readable as possible. It would be good to have One Obvious Way of creating keyword data structures.
Lambdas are a Python language feature we should provide clear guidance on. Used well they simplify code and are perfectly readable; used poorly, and code becames opaque and bug-prone. Although use should be restrained, an accommodation should be made for Pandas and sorting, albeit with caveats to ensure usage doesn't compromise readability. And a => syntax could be nice.
The Walrus operator risks encouraging buggy code by conflating assignment with evaluation. PHP stands as a warning as to where this can lead. There are few cases where the convenience of the Walrus operator outweigh its risks and even these are not clear-cut. From a When of Python view, the Walrus operator should be in Deprecated Python, or possibly Situational Python but with very few situations accepted. The Walrus will only very occasionally belong in production code.
The Walrus operator finally seemed to have found a practical use case - as a way to make collections of strings or integers without as much boiler plate as the alternative without the operator. But Python has a better approach already - Enum - and in Python 3.11 it is even easier to use with strings (StrEnum). So the Walrus operator still struggles to find a problem for which it is the best solution.
How we handle type hinting will define the future of Python for good or bad. Type hinting is useful as glorified commenting and as such should be part of everyone's Everyday Python. It should be part of Common Python. Type hinting is likely to be widely used in the code people encounter so we all need to be comfortable reading simple type hinting. Some enterprise and library codebases will benefit from a more strict and enforced form of type "hinting" and further advances in type hinting and checkers like mypy will improve the developer experience of using this feature. What has your experience of type hinting been? Do you agree with this post? Do you disagree? Please comment below.
The for else construct is arguably too confusing for most Python coders and there are simple alternatives that are safe and versatile. A clear candidate for deprecation.
Python pickle is something many of us have had a love-hate relationship with. We've loved it before using it and hated it afterwards ;-) Maybe we should put pickle in the Deprecate Python category?