Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Private Attributes
test.test_mutants.Horrid Class Reference

List of all members.

Public Member Functions

def __init__
def __hash__
def __eq__
def __ne__
def __repr__

Public Attributes

 i

Static Private Attributes

 __lt__ = __le____gt____ge____ne__

Detailed Description

Definition at line 82 of file test_mutants.py.


Constructor & Destructor Documentation

def test.test_mutants.Horrid.__init__ (   self,
  i 
)

Definition at line 83 of file test_mutants.py.

00083 
00084     def __init__(self, i):
00085         # Comparison outcomes are determined by the value of i.
00086         self.i = i
00087 
00088         # An artificial hashcode is selected at random so that we don't
00089         # have any systematic relationship between comparison outcomes
00090         # (based on self.i and other.i) and relative position within the
00091         # hash vector (based on hashcode).
00092         # XXX This is no longer effective.
00093         ##self.hashcode = random.randrange(1000000000)

Here is the caller graph for this function:


Member Function Documentation

def test.test_mutants.Horrid.__eq__ (   self,
  other 
)

Definition at line 98 of file test_mutants.py.

00098 
00099     def __eq__(self, other):
00100         maybe_mutate()   # The point of the test.
00101         return self.i == other.i

Here is the call graph for this function:

Definition at line 94 of file test_mutants.py.

00094 
00095     def __hash__(self):
00096         return 42
00097         return self.hashcode

def test.test_mutants.Horrid.__ne__ (   self,
  other 
)

Definition at line 102 of file test_mutants.py.

00102 
00103     def __ne__(self, other):
00104         raise RuntimeError("I didn't expect some kind of Spanish inquisition!")

Definition at line 107 of file test_mutants.py.

00107 
00108     def __repr__(self):
00109         return "Horrid(%d)" % self.i
00110 
00111 # Fill dict d with numentries (Horrid(i), Horrid(j)) key-value pairs,
00112 # where i and j are selected at random from the candidates list.
00113 # Return d.keys() after filling.


Member Data Documentation

test.test_mutants.Horrid.__lt__ = __le____gt____ge____ne__ [static, private]

Definition at line 105 of file test_mutants.py.

Definition at line 85 of file test_mutants.py.


The documentation for this class was generated from the following file: