File: unhashable.py

package info (click to toggle)
python-pyfakefs 5.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,476 kB
  • sloc: python: 20,153; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import sys
import types


class Unhashable(types.ModuleType):
    """
    Unhashable module, used for regression test for  #923.
    """

    @property
    def Unhashable(self):
        return self

    def __eq__(self, other):
        raise NotImplementedError("Cannot compare unhashable")


if sys.modules[__name__] is not Unhashable:
    sys.modules[__name__] = Unhashable("unhashable")