Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

y_py has no attribute Y.Event #81

Open
kafonek opened this issue Oct 20, 2022 · 1 comment
Open

y_py has no attribute Y.Event #81

kafonek opened this issue Oct 20, 2022 · 1 comment

Comments

@kafonek
Copy link
Contributor

kafonek commented Oct 20, 2022

y_py.pyi defines Event

ypy/y_py.pyi

Line 21 in d3387a5

Event = Union[YTextEvent, YArrayEvent, YMapEvent, YXmlTextEvent, YXmlElementEvent]
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'

@Waidhoferj
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants