
Hi all - Thanks for all the helpful suggestions on this proposal! One question has come up that I wanted to bring back to the full typing-sig list: We are thinking about what kind of runtime logic `@typing.override` should have. Jelle suggested that it should set an `__override__` attribute that would allow introspection. This seems like an obviously good idea and we've added it to our reference implementation [1][2] as well as the draft proposal. Several folks also suggested that we consider adapting the existing runtime enforcement in `@overrides.overrides`. This could be very cool, because override safety for renames makes sense even for folks who don't use static typing, plus it may help folks who run unit test more often than type checking get feedback faster. The main downside is that it would add a bit of import-time overhead; my estimate is something like 120 microseconds per override [3]. This is relatively minor, although for a million line codebase we think it might introduce something like 0.75 seconds of fixed cost import time. It may be possible to reduce this significantly by moving the implementation to C. From the Pyre team's side, I'm not sure we would want runtime enforcement on our largest codebases since the type checker can catch errors just as well, but we already have @pyre_extensions.override so this is not a major concern. Do y'all have opinions on this? For now, I've moved the idea into the "Open Issues" section of the draft proposal [4] --- [1] Add `__override__` attribute in `pyre_extensions` https://github.com/facebook/pyre-check/blob/main/pyre_extensions/__init__.py... [2] Unit tests for `__override__` behavior https://github.com/facebook/pyre-check/blob/main/pyre_extensions/tests/basic... [3] Simple perf estimate for `@overrides.overrides` https://github.com/stroxler/python_open_source_examples/tree/main/timing_ove... [4] Draft PEP for @typing.override https://docs.google.com/document/d/1dBkHKaOCqttnqzPo7kw1dzvbuFzNoOdx7OPyfbJH...