def __new__(cls):
    'Even if users construct TaskContext instead of using get, give them the singleton.'
    taskContext = cls._taskContext
    if (taskContext is not None):
        return taskContext
    cls._taskContext = taskContext = object.__new__(cls)
    return taskContext
Even if users construct TaskContext instead of using get, give them the singleton.
def __new__(cls):
    
    taskContext = cls._taskContext
    if (taskContext is not None):
        return taskContext
    cls._taskContext = taskContext = object.__new__(cls)
    return taskContext