@deprecated: Jelle proposed a decorator that allows functions (and overloads?) to be considered deprecated. The type checker should report the error message mentioned in the decorator argument.
Example:
@deprecated("Use inspect.signature instead")
def getargspec() -> None: ...
The overall feedback was positive.
@typing_error: Jelle also proposed making certain combinations of parameter types to be deprecated
Example:
@typing_error("Using pow() with a mod of 0 will throw a runtime error")
def pow(base: int, exp: int, mod: Literal[0]) -> Never: …
Feedback from the audience: The above overload doesn’t help prevent pow(x, y, 1 - 1) since that won’t match the above overload. Other examples are needed to motivate this feature.
PyCon Typing Summit 2023: We decided to have another summit at PyCon, given that the last one was well-received and the 2023 proposal deadline is coming up. Jelle and Pradeep agreed to co-organize the event. We will probably reach out to speakers early next year.
If you're interested in presenting next time, shoot me an email.
Quick reminder that the Typing Meetup is today (in half an hour): 10 am San Francisco time (UTC-8) / 6:00 pm London time (UTC).Zoom link: https://us02web.zoom.us/j/89193699423 [1]. The meeting will be automatically recorded from the time it starts.Agenda:
- Jelle Zijlstra, Typing support for @deprecated and @typing_error
I'll share the recording and notes after the meetup. [2] All are welcome, so feel free to just join the meeting.[1]: Public Google Calendar invite: https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=azlkb3A3MnF0YnM3b2dvcDYxOGszMmluZjAgZ29oYW5wcmFAbQ&tmsrc=gohanpra%40gmail.com--S Pradeep Kumar