jfhbrook / pyee

A rough port of Node.js's EventEmitter to Python with a few tricks of its own
https://github.com/jfhbrook/public
MIT License
371 stars 39 forks source link

type-safe TypedEventEmitter implementation #101

Closed jfhbrook closed 1 year ago

jfhbrook commented 2 years ago

It would be cool to have a type-safe TypedEventEmitter[E] class which picks up some of the parts I wasn't able to make work from https://github.com/jfhbrook/pyee/pull/97 .

jfhbrook commented 1 year ago

My current opinion on this is that there are other abstractions - namely channels - which can solve most of the use cases of event emitters with the desired type safety. This is an interesting puzzle, but I don't plan on adding this to pyee.