diff options
Diffstat (limited to 'Lib/test/support/__init__.py')
-rw-r--r-- | Lib/test/support/__init__.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index c82037e..d34f2ef 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -113,7 +113,7 @@ __all__ = [ "run_with_locale", "swap_item", "swap_attr", "Matcher", "set_memlimit", "SuppressCrashReport", "sortdict", "run_with_tz", "PGO", "missing_compiler_executable", "fd_count", - "ALWAYS_EQ", "LARGEST", "SMALLEST" + "ALWAYS_EQ", "NEVER_EQ", "LARGEST", "SMALLEST" ] class Error(Exception): @@ -3115,6 +3115,17 @@ class _ALWAYS_EQ: ALWAYS_EQ = _ALWAYS_EQ() +class _NEVER_EQ: + """ + Object that is not equal to anything. + """ + def __eq__(self, other): + return False + def __ne__(self, other): + return True + +NEVER_EQ = _NEVER_EQ() + @functools.total_ordering class _LARGEST: """ |