diff --git a/py25/bacpypes/task.py b/py25/bacpypes/task.py index b262cd8..e7c4d24 100755 --- a/py25/bacpypes/task.py +++ b/py25/bacpypes/task.py @@ -92,6 +92,9 @@ class _Task(DebugContents, Logging): _task_manager.resume_task(self) + def __lt__(self, other): + return id(self) < id(other) + # # OneShotTask # diff --git a/py27/bacpypes/task.py b/py27/bacpypes/task.py index af2407d..a9594c7 100755 --- a/py27/bacpypes/task.py +++ b/py27/bacpypes/task.py @@ -92,6 +92,9 @@ class _Task(DebugContents, Logging): _task_manager.resume_task(self) + def __lt__(self, other): + return id(self) < id(other) + # # OneShotTask # diff --git a/py34/bacpypes/singleton.py b/py34/bacpypes/singleton.py index 715f013..d08ae21 100755 --- a/py34/bacpypes/singleton.py +++ b/py34/bacpypes/singleton.py @@ -56,18 +56,18 @@ class _SingletonMetaclass(type): # Singleton # -class Singleton(object): +class Singleton(metaclass=_SingletonMetaclass): - __metaclass__ = _SingletonMetaclass + pass # # _SingletonLoggingMetaclass # class _SingletonLoggingMetaclass(_SingletonMetaclass, debugging._LoggingMetaclass): + pass -class SingletonLogging(object): - - __metaclass__ = _SingletonLoggingMetaclass +class SingletonLogging(metaclass=_SingletonLoggingMetaclass): + pass diff --git a/py34/bacpypes/task.py b/py34/bacpypes/task.py index af2407d..a9594c7 100755 --- a/py34/bacpypes/task.py +++ b/py34/bacpypes/task.py @@ -92,6 +92,9 @@ class _Task(DebugContents, Logging): _task_manager.resume_task(self) + def __lt__(self, other): + return id(self) < id(other) + # # OneShotTask # diff --git a/tests/test_utilities/test_time_machine.py b/tests/test_utilities/test_time_machine.py index f827edf..fcce5a2 100644 --- a/tests/test_utilities/test_time_machine.py +++ b/tests/test_utilities/test_time_machine.py @@ -203,4 +203,4 @@ class TestTimeMachine(unittest.TestCase): # function called, no time has passed assert ft1.process_task_called == 4 assert ft2.process_task_called == 3 - assert time_machine.current_time == 5.0 \ No newline at end of file + assert time_machine.current_time == 5.0