ypy
ypy copied to clipboard
y_py has no attribute `Y.Event`
y_py.pyi
defines Event
https://github.com/y-crdt/ypy/blob/d3387a5b4717a50992d85119bc063ba23e541261/y_py.pyi#L21 so it shows up when tab completing in Jupyter or an editor. However trying to use it will raise AttributeError: module 'y_py' has no attribute 'Event'
There is not a corresponding class in the actual API. This is used as an annotation to specify the events in observe_deep
and hopefully provide some type narrowing support for strongly typed code analyzers.
But that is a pain I agree. We could specify the exhaustive union in observe_deep
, but it might make the annotations less legible.