Commit Graph

16 Commits

Author SHA1 Message Date
Brian Skinn 42c33bb982
PEP 698: Fix typos and suggest edits (#2990)
- Some simple typo fixes.
- Harmonizing the code formatting of some functions & packages
- Some suggested punctuation changes
- Change to the external link to `overrides` package to allow code formatting in the link
- Converting uses of "get" to "set" when referring to adding `__override__`
  to decorated objects, for semantic consistency

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-03-11 07:17:51 -08:00
Steven Troxler 4224fa7f8d
PEP 698: Mark as Accepted (#2991)
See https://github.com/python/steering-council/issues/160#issuecomment-1409208844
2023-01-30 21:34:44 -08:00
Steven Troxler c582627501
PEP 698: Tighten up the section about typing rules. (#2969)
In our original draft to PEP 698, we wanted to emphasize that the
PEP exclusively deals with `@override`, rather than adding new
rules about override type signature.

We did this by stating that compatibility rules were pre-existing.
This is true de-facto, because all type checkers implement at least
some compatibility checks, but upon a careful re-reading it turns out
compatibility checks on subclass methods are not specified in any
PEP.

As a result, we should simply state that this PEP is not adding
any new rules on signatures, without alluding to type checking
rules that are not specified in previous PEPs.

I will separately start a discussion in typing-sig about whether we
want to provide a paper trail in PEPs - either a new PEP or a
light amendment to PEP 484 - to make compatibility checks explicit.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-01-18 16:33:42 +00:00
Steven Troxler 32c692b214
PEP 698: discuss.python.org thread to post-history (#2948)
* PEP 698: discuss.python.org thread to post-history

As far as I know this is the last update needed ahead of SC
review.

* Also change the Discussions-To header
2023-01-04 11:00:29 -08:00
Steven Troxler 6a72444a8e
PEP 698: reword "value add" -> "benefits" (#2897)
Maybe I've spent too much time in big-company roadmapping
meetings, I didn't used to accidentally say things like this :D
2022-11-20 17:36:35 -06:00
Steven Troxler d5b28cc9c1
PEP 698: reword the disadvantages section (#2894)
We claimed that there are two disadvantages to overrides:
it makes code more verbose, and requires developers to update
subclasses when possibly-breaking changes happen to base classes.

In discussion, it was pointed out that the second disadvantage is
kind of strange - it is exactly the same as the advantage of
using @override in the first place because the whole point is that
it is not usually safe to assume subclasses can be unchanged when
a method they override is removed from a base class.

I think just pointing out verbosity is good enough, I think it's
understood that more verbose code potentially requires more edits
to change, and in reality I think the case when it was safe to
ignore invalidated overrides is pretty rare so making that a big
focus seems a little weird.
2022-11-20 07:22:50 -08:00
Steven Troxler 337df6bef5
PEP 698: Include discussion of pinning the ancestor class (#2893)
This idea came up in the PEP discussion:
https://discuss.python.org/t/pep-698-a-typing-override-decorator/20839/4

We decided against it, but as promised I am including the idea
and potential upside as well as our rationale for not including
it in the "Rejected Alternatives" section.
2022-11-18 12:04:29 -08:00
tk-woven 686a5a9e21
PEP 698: fix typo enumerating runtime enforcement rejections (#2891) 2022-11-17 17:44:35 -08:00
Brett Cannon 11669a5772
PEP 698: Fix capitalization of "TypeScript" 2022-11-08 15:12:42 -08:00
Steven Troxler 848d0908c9
PEP 698: Change the wording for strict mode section (#2874)
At this time, Pyre still does not have strict override enforcement.

This (and supporting codemod tools) are still something we want,
but given that we have not yet delivered this and do not have a firm
ETA we should not make claims about specific plans in the PEP text.
2022-11-07 14:43:56 -08:00
Steven Troxler 37a5ea8fe6
PEP 698: Add `__override__` flag to runtime behavior (#2855)
We decided to add this for two reasons:

- It was specifically requested by the author of the `overrides`
  library, because there there are some handy runtime uses
  of override information (such as propagating docstrings, which
  we highlight as a concrete example)
- We realized that we actually added `__final__` to
  `@typing.final` in spite of it not being specified in PEP 591,
  which we felt strongly suggests that even if we omit it we
  would later change our minds.

This runtime behavior is currently implemented in typing_extensions
(see https://github.com/python/typing_extensions/pull/86) as well
as pyre_extensions.
2022-10-28 16:09:33 -07:00
Steven Troxler 5d975396db
PEP 698: Add Discussions-To and Post-History (#2834)
* Add Discussions-To header pointing to Typing-SIG
* Add Post-History header

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-13 23:38:29 -05:00
Mikko Korpela 67e29bf61a
Fix typos in PEP 698 (#2830) 2022-10-11 09:13:01 -07:00
Jelle Zijlstra 83b976da18
Add Typing Topic (#2670)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-06 17:36:39 -07:00
Zachary Blackwood 778c260e35
PEP 698: Fix typo in example code (#2813) 2022-10-05 12:00:43 -07:00
Steven Troxler 90ae6434f6
PEP 698: Override Decorator for Static Typing (`@typing.override`) (#2783)
See earlier draft document at
https://docs.google.com/document/d/1dBkHKaOCqttnqzPo7kw1dzvbuFzNoOdx7OPyfbJHuV4/edit#
and discussion on `typing-sig` at
https://mail.python.org/archives/list/typing-sig@python.org/thread/7JDW2PKGF6YTERUJGWM3BRP3GDHRFP4O/
2022-09-23 10:42:25 -07:00