[Pyobjc-dev] Different result between PyObjC 1.x and 2.x when calling NSIndexSet. getIndexes_maxCou
Brought to you by:
ronaldoussoren
|
From: Luc H. <lu...@ho...> - 2008-06-25 07:00:09
|
Greetings,
# -- [begin snippet] -------------------------------------------------
import sys
print "PYTHON VERSION:"
print sys.version
import objc
print "PYOBJC VERSION:"
print objc.__version__
from Foundation import NSMutableIndexSet, NSRange
s = NSMutableIndexSet.alloc().init()
for i in range(1,16,2):
s.addIndex_(i)
print "NSINDEXSET CALL result:"
if objc.__version__.startswith('1'):
print s.getIndexes_maxCount_inIndexRange_(4, NSRange(0,4))
else:
print s.getIndexes_maxCount_inIndexRange_(None, 4, NSRange(0,4))
# -- [end snippet] --------------------------------------------------
Here are the results I get...
...on OS X 10.4 using a custom built PyObjC 1.4:
PYTHON VERSION:
2.4.4 (#1, Oct 18 2006, 10:34:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)]
PYOBJC VERSION:
1.4.1a0
NSINDEXSET CALL result:
(4, (1, 3, 5, 7), <Foundation.NSRange location=0 length=4>)
...on OS X 10.5 with the default PyObjC 2.0.1:
PYTHON VERSION:
2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)]
PYOBJC VERSION:
2.0.1
NSINDEXSET CALL result:
(2, ())
...on OS X 10.5 with custom built Python 2.5 and PyObjC 2.1:
PYTHON VERSION:
2.5 (r25:51908, Apr 15 2008, 08:22:04)
[GCC 4.0.1 (Apple Inc. build 5478)]
PYOBJC VERSION:
2.1a0
NSINDEXSET CALL result:
(2, ())
Any idea what happens here ? Since PyObjC 2.x is not backward
compatible with OS X 10.4 and PyObjC 1.4 does not compile under OS X
10.5 I have to juggle between the two to work on my app and if there
are semantic changes for some calls in addition to the version
incompatibilities, it's quickly going to get painful... :)
--
Luc Heinrich - lu...@ho...
|