File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def __init__(self, *args):
2020
2121@total_ordering
2222class Action (Enum ):
23- """Core actions in the Prisoner's Dilemna .
23+ """Core actions in the Prisoner's Dilemma .
2424
2525 There are only two possible actions, namely Cooperate or Defect,
2626 which are called C and D for convenience.
@@ -29,23 +29,14 @@ class Action(Enum):
2929 C = 1 # Cooperate
3030 D = 0 # Defect
3131
32- def __bool__ (self ):
33- return bool (self .value )
34-
35- def __eq__ (self , other ):
36- return self .value == other .value
37-
38- def __hash__ (self ):
39- return hash (self .value )
40-
4132 def __lt__ (self , other ):
4233 return self .value < other .value
4334
4435 def __repr__ (self ):
45- return "{}" . format ( self .name )
36+ return self .name
4637
4738 def __str__ (self ):
48- return "{}" . format (self . name )
39+ return repr (self )
4940
5041 def flip (self ):
5142 """Returns the opposite Action."""
You can’t perform that action at this time.
0 commit comments