ypy icon indicating copy to clipboard operation
ypy copied to clipboard

y_py has no attribute `Y.Event`

Open kafonek opened this issue 2 years ago • 1 comments

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'

kafonek avatar Oct 20 '22 18:10 kafonek

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.

Waidhoferj avatar Nov 07 '22 05:11 Waidhoferj