NEW: Add Event to public API#501
Conversation
Downstream packages that want to use Event to type hint their APIs should be able to import Event without accessing private modules.
f039f14 to
9449cab
Compare
|
Force-pushed to rebase on latest main. |
|
btw we are on code freeze now, we could try to squeeze this in if it does not impact functionality and is an easy fix.
What are your thoughts on
This was not done because I worried that people just try to construct them directly, as they are not meant to be an entry point of this module. However, it does feel weird that important objects like these are not explicitly documented, and it takes a few clicks to get to their docs. Typing is one of the straws, too, if not the last. |
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
|
Per offline chat with @leofang: I'll merge this now and will work on api.rst changes separately, after we lift our code freeze. |
|
I think this is the main issue. Objects like |
I agree (based on offline chat, I think Leo, too). Did you see my previous comment? — "I'll merge this now and will work on api.rst changes separately, after we lift our code freeze." I'll send that PR to you for review. |
Yes. I was just expressing my agreement. No rush from me on this. I didn't even expect this PR to be merged until next month.
I'd be happy to review that. |
Oh, I assumed that it's helpful to you (and in general) to have public access to |
Downstream packages that want to use
Eventto type hint their APIs should be able to importEventwithout accessing private modules.#469 (comment)
I understand that
Events should not be constructed directly, but having__new__()raise a RuntimeError should be sufficient to prevent that.