Thanks to Eric Traut who tested all the code examples in Pyright and
raised implementation concerns about ``Self`` type in aliases.
I ran into implementation issues in Pyre too. This is because Pyre
preprocesses things like ``Self`` in an early phase and does alias
resolution in a later phase. Mixing the two would lead to a lot of
hacks.
* Address Guido's comments from initial PR
* Update functions-as-types based on Pradeep's feedback
* Fix some markup, address comments on endpoint example
* Rearrange Motivation and Rationale
* Move the language comparison subsection to Rational
* Fix more markup errors
* Rework "Motivation" section again
Going with Pradeep's suggested order:
- untyped example
- correct types
- partially-typed code
- our proposal
* Fix more lint errors
* Add a section highlighting a concern about -> readability
* Update the add/wrap/flatmap example
* Wording change suggested by AlexWaygood
* Add missing return annotation
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Break up long sentence
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Break up long sentence (thanks Jelle)
* Reword awkward sentence (thanks Pradeep)
* Rearrange paragraphs in Motivation
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
A number of cleanups also happened, improving readability of various sections and examples, but the only *semantic* change here is that TypeVarTuples can now be substituted with unbounded tuples (previously that was explicitly forbidden, but we convinced ourselves that there is no reason for that).
* Remove incorrect implementation of pop(). There is an implementation in collections.MutableMapping so it is not needed. Add implementation of __contains__.
* Remove outdated section on differences with PEP 558.
* Elaborate the Abstract
* Add "Misnesting" example
* The return value has already been removed in the public C API macros
* Clarify that converting Py_TYPE() macro was an incompatible change
* Don't convert l-value macros
* Add "Examples of duplication of side effects" section
* Remove the gcc -O0 versus gcc -Og benchmark: it's not relevent for
this PEP.