Hi Stefano,
Thank you for submitting PEP 637 (Support for indexing with keyword arguments). The Steering Council has reviewed the PEP and after careful consideration, we have decided to reject the PEP. There are a number of reasons for this, but fundamentally we do not believe the benefit is great enough to outweigh the cost of the new syntax.
The benefits of the new syntax as outlined in the PEP are not particularly strong, and community support for the new syntax seems low. The new syntax doesn’t provide an obvious way to do something that is currently error-prone, and doesn’t open up new possibilities that were not possible before. While there are certainly cases that could use the new syntax, for many of them it’s not clear that it would be a win, or that third-party libraries would indeed use the syntax. The Steering Council isn’t really convinced by any of the suggested uses in the PEP.
The strongest argument for the new syntax comes from the typing side of Python. The Steering Council is not particularly convinced it is of significant benefit to the static type checking language, but even if it were, at this point we’re reluctant to add general Python syntax that only (or mostly) benefits the static typing language. If the syntax would be of great benefit to static typing, it might be time to discuss letting go of the requirement that the typing language be a subset of Python -- but whether this feature is important enough to consider that is up to the typing community.
The SC considers the cost of the new syntax significant. It’s not a natural fit, as shown by the corner cases discussed in the PEP. It’s difficult to teach, as indexing and function calls are not as interchangeable or equivalent as they may appear. Looking at more complex expressions with the new syntax, mentally parsing them is significantly harder than the equivalent without the new syntax, even if it requires more lines of code to do the same thing.
In addition to all that, the SC is worried about the performance of indexing in CPython and in other Python implementations, considering it’s a very common operation, and about the suggested new __getitem__ protocol, particularly the confusing corner cases of indexing with keywords and zero or one positional items. These are not, however, the main reason we decided to reject the PEP.
With our appreciation,
For the whole Python Steering Council,
Thomas.
--
Thomas Wouters <
thomas@python.org>
Hi! I'm an email virus! Think twice before sending your email to help me spread!