Build a minimal event emitter class with on, off, emit, listener_count, and remove_all methods.
Constraints
Example
>>> emitter = EventEmitter()
>>> logs = []
>>> unsub = emitter.on('greet', lambda name: logs.append(f'Hello {name}'))
>>> emitter.emit('greet', 'Alice')
True
>>> logs
['Hello Alice']
>>> unsub()
>>> emitter.emit('greet', 'Bob')
False
>>> logs
['Hello Alice']
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints