source: listenerpy/tudelft_utilities_listener/Listenable.py

Last change on this file was 208, checked in by wouter, 3 years ago

#87 add test just importing the file, as smoke test....

File size: 603 bytes
Line 
1from abc import abstractmethod
2from abc import ABC
3from typing import TypeVar, Generic, List
4
5from tudelft_utilities_listener.Listener import Listener
6
7
8TYPE= TypeVar('TYPE')
9
10class Listenable (ABC, Generic[TYPE]):
11 '''
12 Simple reusable listenable
13 @param <TYPE> the type of the data being passed around.
14 '''
15 @abstractmethod
16 def addListener(self, l:Listener[TYPE]):
17 '''
18 Add listener for this observable
19
20 @param l the listener to add
21 '''
22
23 @abstractmethod
24 def removeListener(self, l:Listener[TYPE] ):
25 '''
26 Remove listener for this observable
27
28 @param l the listener to remove
29 '''
Note: See TracBrowser for help on using the repository browser.