File tree Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Expand file tree Collapse file tree 4 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -366,17 +366,15 @@ def __str__(self):
366
366
def __hash__ (self ):
367
367
return hash (self .name ()) # | hash(self.model().name())
368
368
369
- def __cmp__ (self , other ):
370
- if other is None :
371
- return 1
372
- if not isinstance (other , Klass ):
373
- return 1
374
- if self .model () is not other .model ():
375
- value = cmp (self .model ().name (), other .model ().name ())
376
- if value == 0 :
377
- value = cmp (self .name (), other .name ())
378
- return value
379
- return cmp (self .name (), other .name ())
369
+ def __eq__ (self , other ):
370
+ if other is None or not isinstance (other , Klass ):
371
+ return False
372
+ #if self.model() is not other.model():
373
+ # value = cmp(self.model().name(), other.model().name())
374
+ # if value == 0:
375
+ # value = cmp(self.name(), other.name())
376
+ # return value
377
+ return self .name () == other .name ()
380
378
381
379
382
380
## Warnings ##
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def serialNum(self):
41
41
# return result
42
42
def __eq__ (self , other ):
43
43
return self ._className == other ._className and self ._serialNum == other ._serialNum
44
-
44
+ #according to http://python3porting.com/preparing.html hash will then be set to None automatically
45
45
def __hash__ (self ):
46
46
return hash (self ._className ) ^ hash (self ._serialNum )
47
47
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ def test(store):
5
5
for n in nodes :
6
6
children = n .children ()
7
7
if children :
8
- children . sort ( key = lambda c : c .serialNum )
8
+ sorted ( children , key = lambda c : c .serialNum () )
9
9
assert n .value () == '' .join ([c .value () for c in children ])
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ def readArgs(self, args):
79
79
MKBasic MKNone MKString MKDateTime MKEnums MKDefaultMinMax
80
80
MKTypeValueChecking MKInheritance MKInheritanceAbstract
81
81
MKList MKObjRef MKObjRefReuse MKDelete MKDeleteMark
82
+ MKBackRef MKClone MKDump MKRefresh
82
83
MKMultipleStores MKMultipleThreads
83
84
MKModelInh1 MKModelInh2 MKModelInh3
84
85
MKExcel
You can’t perform that action at this time.
0 commit comments