Commits

Ronald Oussoren  committed ce4d2de

- Methods with output parameters and a 'void' return type are wrapped slightly
differently from normal methods with output parameters:
1) The 'original' return value is no longer part of the tuple, this
is a more natural translation to Python
2) If there is only 1 output parameter the method returns the value of
that parameter instead of a tuple containing that value.
TODO: update documentation
- Also update the Todo example to deal with this change
- Also update the unittests (that made it so much easier to verify that
the change was correct!)
- Update the readme for the PB templates, it mentioned some non-existing
templates. Also added a description for a template that will be added
soon.

  • Participants
  • Parent commits 8f324b5

Comments (0)

Files changed (20)

File pyobjc/Doc/TODO

 
 * tests for all functions in ``Modules/*/*Mapping*.m``
 
+* tests where Python implementation of method with output arguments returns
+  the wrong value (type, number of values)
+
 
 Less important items
 --------------------

File pyobjc/Examples/Todo/InfoWindowController.py

 
 
 def clearButtonMatrix(matrix):
-    _, rows, cols = matrix.getNumberOfRows_columns_()
+    rows, cols = matrix.getNumberOfRows_columns_()
 
     for i in range(rows):
     	cell = matrix.cellAtRow_column_(i, 0)

File pyobjc/Examples/Todo/ToDoDocument.py

     	if newItems:
     		self._currentItems = newItems.mutableCopy()
     	else:
-    		numRows, numCols = 6,1 # self.itemList.getNumberOfRows_columns_()
+    		numRows, numCols = self.itemList.getNumberOfRows_columns_()
     		self._currentItems = NSMutableArray.alloc().initWithCapacity_(numRows)
 
     		for d in range(numRows):

File pyobjc/Lib/Foundation/test/test_nscoder.py

                 # call superclass implementation:
                 #    self = super(CodeClass1, self).initWithCoder_(coder)
                 self = self.init()
-                self.intVal = coder.decodeValueOfObjCType_at_(objc._C_INT)[1]
-                self.dblVal = coder.decodeValueOfObjCType_at_(objc._C_DBL)[1]
+                self.intVal = coder.decodeValueOfObjCType_at_(objc._C_INT)
+                self.dblVal = coder.decodeValueOfObjCType_at_(objc._C_DBL)
                 self.dblArray = coder.decodeArrayOfObjCType_count_at_(objc._C_DBL, 4)
                 return self
 

File pyobjc/Lib/objc/test/test_methods.py

 
     def testCharOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutChar_(), (None, -128))
-        self.assertEquals(self.obj.passOutChar_(), (None, 0))
-        self.assertEquals(self.obj.passOutChar_(), (None, 127))
+        self.assertEquals(self.obj.passOutChar_(), -128)
+        self.assertEquals(self.obj.passOutChar_(), 0)
+        self.assertEquals(self.obj.passOutChar_(), 127)
 
     def testCharInOut(self):
-        self.assertEquals(self.obj.passInOutChar_('\x10'), (None, 0x3a))
+        self.assertEquals(self.obj.passInOutChar_('\x10'), 0x3a)
 
     def testUCharIn(self):
         self.assertEquals(self.obj.passInUChar_(10), 19)
 
     def testUCharOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutUChar_(), (None, 0))
-        self.assertEquals(self.obj.passOutUChar_(), (None, 128))
-        self.assertEquals(self.obj.passOutUChar_(), (None, 255))
+        self.assertEquals(self.obj.passOutUChar_(), 0)
+        self.assertEquals(self.obj.passOutUChar_(), 128)
+        self.assertEquals(self.obj.passOutUChar_(), 255)
 
     def testUCharInOut(self):
-        self.assertEquals(self.obj.passInOutUChar_(10), (None, 52))
+        self.assertEquals(self.obj.passInOutUChar_(10), 52)
 
     def testShortIn(self):
         self.assertEquals(self.obj.passInShort_(10), 19)
 
     def testShortOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutShort_(), (None, -(1 << 14)))
-        self.assertEquals(self.obj.passOutShort_(), (None, -42))
-        self.assertEquals(self.obj.passOutShort_(), (None, 0))
-        self.assertEquals(self.obj.passOutShort_(), (None, 42))
-        self.assertEquals(self.obj.passOutShort_(), (None, (1 << 14)))
+        self.assertEquals(self.obj.passOutShort_(), -(1 << 14))
+        self.assertEquals(self.obj.passOutShort_(), -42)
+        self.assertEquals(self.obj.passOutShort_(), 0)
+        self.assertEquals(self.obj.passOutShort_(), 42)
+        self.assertEquals(self.obj.passOutShort_(), 1 << 14)
 
     def testShortInOut(self):
-        self.assertEquals(self.obj.passInOutShort_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutShort_(-100), (None, -58))
-        self.assertEquals(self.obj.passInOutShort_(-100.0), (None, -58))
+        self.assertEquals(self.obj.passInOutShort_(10), 52)
+        self.assertEquals(self.obj.passInOutShort_(-100), -58)
+        self.assertEquals(self.obj.passInOutShort_(-100.0), -58)
 
     def testUShortIn(self):
         self.assertEquals(self.obj.passInUShort_(10), 19)
 
     def testUShortOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutUShort_(), (None, 0))
-        self.assertEquals(self.obj.passOutUShort_(), (None, 42))
-        self.assertEquals(self.obj.passOutUShort_(), (None, (1 << 14)))
+        self.assertEquals(self.obj.passOutUShort_(), 0)
+        self.assertEquals(self.obj.passOutUShort_(), 42)
+        self.assertEquals(self.obj.passOutUShort_(), (1 << 14))
 
     def testUShortInOut(self):
-        self.assertEquals(self.obj.passInOutUShort_(10), (None, 52))
+        self.assertEquals(self.obj.passInOutUShort_(10), 52)
 
     def testIntIn(self):
         self.assertEquals(self.obj.passInInt_(10), 19)
 
     def testIntOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutInt_(), (None, -(1 << 30)))
-        self.assertEquals(self.obj.passOutInt_(), (None, -42))
-        self.assertEquals(self.obj.passOutInt_(), (None, 0))
-        self.assertEquals(self.obj.passOutInt_(), (None, 42))
-        self.assertEquals(self.obj.passOutInt_(), (None, (1 << 30)))
+        self.assertEquals(self.obj.passOutInt_(), -(1 << 30))
+        self.assertEquals(self.obj.passOutInt_(), -42)
+        self.assertEquals(self.obj.passOutInt_(), 0)
+        self.assertEquals(self.obj.passOutInt_(), 42)
+        self.assertEquals(self.obj.passOutInt_(), (1 << 30))
 
     def testIntInOut(self):
-        self.assertEquals(self.obj.passInOutInt_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutInt_(-100), (None, -58))
-        self.assertEquals(self.obj.passInOutInt_(-100.0), (None, -58))
+        self.assertEquals(self.obj.passInOutInt_(10), 52)
+        self.assertEquals(self.obj.passInOutInt_(-100), -58)
+        self.assertEquals(self.obj.passInOutInt_(-100.0), -58)
 
     def testUIntIn(self):
         self.assertEquals(self.obj.passInUInt_(10), 19)
 
     def testUIntOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutUInt_(), (None, 0))
-        self.assertEquals(self.obj.passOutUInt_(), (None, 42))
-        self.assertEquals(self.obj.passOutUInt_(), (None, (1 << 30)))
+        self.assertEquals(self.obj.passOutUInt_(), 0)
+        self.assertEquals(self.obj.passOutUInt_(), 42)
+        self.assertEquals(self.obj.passOutUInt_(), (1 << 30))
 
     def testUIntInOut(self):
-        self.assertEquals(self.obj.passInOutUInt_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutUInt_(10.0), (None, 52))
+        self.assertEquals(self.obj.passInOutUInt_(10), 52)
+        self.assertEquals(self.obj.passInOutUInt_(10.0), 52)
 
     def testLongIn(self):
         self.assertEquals(self.obj.passInLong_(10), 19)
 
     def testLongOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutLong_(), (None, -(1 << 30)))
-        self.assertEquals(self.obj.passOutLong_(), (None, -42))
-        self.assertEquals(self.obj.passOutLong_(), (None, 0))
-        self.assertEquals(self.obj.passOutLong_(), (None, 42))
-        self.assertEquals(self.obj.passOutLong_(), (None, (1 << 30)))
+        self.assertEquals(self.obj.passOutLong_(), -(1 << 30))
+        self.assertEquals(self.obj.passOutLong_(), -42)
+        self.assertEquals(self.obj.passOutLong_(), 0)
+        self.assertEquals(self.obj.passOutLong_(), 42)
+        self.assertEquals(self.obj.passOutLong_(), (1 << 30))
 
     def testLongInOut(self):
-        self.assertEquals(self.obj.passInOutLong_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutLong_(-100), (None, -58))
-        self.assertEquals(self.obj.passInOutLong_(-100.0), (None, -58))
+        self.assertEquals(self.obj.passInOutLong_(10), 52)
+        self.assertEquals(self.obj.passInOutLong_(-100), -58)
+        self.assertEquals(self.obj.passInOutLong_(-100.0), -58)
 
     def testULongIn(self):
         self.assertEquals(self.obj.passInULong_(10), 19)
 
     def testULongOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutULong_(), (None, 0))
-        self.assertEquals(self.obj.passOutULong_(), (None, 42))
-        self.assertEquals(self.obj.passOutULong_(), (None, (1 << 30)))
+        self.assertEquals(self.obj.passOutULong_(), 0)
+        self.assertEquals(self.obj.passOutULong_(), 42)
+        self.assertEquals(self.obj.passOutULong_(), (1 << 30))
 
     def testULongInOut(self):
-        self.assertEquals(self.obj.passInOutULong_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutULong_(10.0), (None, 52))
+        self.assertEquals(self.obj.passInOutULong_(10), 52)
+        self.assertEquals(self.obj.passInOutULong_(10.0), 52)
 
     def testLongLongIn(self):
         self.assertEquals(self.obj.passInLongLong_(10), 19)
 
     def testLongLongOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutLongLong_(), (None, -(1L << 60)))
-        self.assertEquals(self.obj.passOutLongLong_(), (None, -42))
-        self.assertEquals(self.obj.passOutLongLong_(), (None, 0))
-        self.assertEquals(self.obj.passOutLongLong_(), (None, 42))
-        self.assertEquals(self.obj.passOutLongLong_(), (None, (1L << 60)))
+        self.assertEquals(self.obj.passOutLongLong_(), -(1L << 60))
+        self.assertEquals(self.obj.passOutLongLong_(), -42)
+        self.assertEquals(self.obj.passOutLongLong_(), 0)
+        self.assertEquals(self.obj.passOutLongLong_(), 42)
+        self.assertEquals(self.obj.passOutLongLong_(), (1L << 60))
 
     def testLongLongInOut(self):
-        self.assertEquals(self.obj.passInOutLongLong_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutLongLong_(-100), (None, -58))
-        self.assertEquals(self.obj.passInOutLongLong_(-100.0), (None, -58))
+        self.assertEquals(self.obj.passInOutLongLong_(10), 52)
+        self.assertEquals(self.obj.passInOutLongLong_(-100), -58)
+        self.assertEquals(self.obj.passInOutLongLong_(-100.0), -58)
 
     def testULongLongIn(self):
         self.assertEquals(self.obj.passInULongLong_(10), 19)
 
     def testULongLongOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutULongLong_(), (None, 0))
-        self.assertEquals(self.obj.passOutULongLong_(), (None, 42))
-        self.assertEquals(self.obj.passOutULongLong_(), (None, (1L << 63)))
+        self.assertEquals(self.obj.passOutULongLong_(), 0)
+        self.assertEquals(self.obj.passOutULongLong_(), 42)
+        self.assertEquals(self.obj.passOutULongLong_(), (1L << 63))
 
     def testULongLongInOut(self):
-        self.assertEquals(self.obj.passInOutULongLong_(10), (None, 52))
-        self.assertEquals(self.obj.passInOutULongLong_(10.0), (None, 52))
+        self.assertEquals(self.obj.passInOutULongLong_(10), 52)
+        self.assertEquals(self.obj.passInOutULongLong_(10.0), 52)
 
     def testFloatIn(self):
         self.assertEquals(self.obj.passInFloat_(10), makeCFloat(90.0))
 
     def testFloatOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutFloat_(), (None, makeCFloat(0.128)))
-        self.assertEquals(self.obj.passOutFloat_(), (None, makeCFloat(1.0)))
-        self.assertEquals(self.obj.passOutFloat_(), (None, makeCFloat(42.0)))
-        self.assertEquals(self.obj.passOutFloat_(), (None, makeCFloat(1e10)))
+        self.assertEquals(self.obj.passOutFloat_(), makeCFloat(0.128))
+        self.assertEquals(self.obj.passOutFloat_(), makeCFloat(1.0))
+        self.assertEquals(self.obj.passOutFloat_(), makeCFloat(42.0))
+        self.assertEquals(self.obj.passOutFloat_(), makeCFloat(1e10))
 
     def testFloatInOut(self):
-        self.assertEquals(self.obj.passInOutFloat_(10), (None, makeCFloat(420)))
-        self.assertEquals(self.obj.passInOutFloat_(10.0), (None, makeCFloat(420)))
-        self.assertEquals(self.obj.passInOutFloat_(0.01), (None, makeCFloat(0.42)))
+        self.assertEquals(self.obj.passInOutFloat_(10), makeCFloat(420))
+        self.assertEquals(self.obj.passInOutFloat_(10.0), makeCFloat(420))
+        self.assertEquals(self.obj.passInOutFloat_(0.01), makeCFloat(0.42))
 
     def testDoubleIn(self):
         self.assertEquals(self.obj.passInDouble_(10), 90.0)
 
     def testDoubleOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutDouble_(), (None, 0.128))
-        self.assertEquals(self.obj.passOutDouble_(), (None, 1.0))
-        self.assertEquals(self.obj.passOutDouble_(), (None, 42.0))
-        self.assertEquals(self.obj.passOutDouble_(), (None, 1e10))
+        self.assertEquals(self.obj.passOutDouble_(), 0.128)
+        self.assertEquals(self.obj.passOutDouble_(), 1.0)
+        self.assertEquals(self.obj.passOutDouble_(), 42.0)
+        self.assertEquals(self.obj.passOutDouble_(), 1e10)
 
     def testDoubleInOut(self):
-        self.assertEquals(self.obj.passInOutDouble_(10), (None, 420))
-        self.assertEquals(self.obj.passInOutDouble_(10.0), (None, 420))
-        self.assertEquals(self.obj.passInOutDouble_(0.01), (None, 0.42))
+        self.assertEquals(self.obj.passInOutDouble_(10), 420)
+        self.assertEquals(self.obj.passInOutDouble_(10.0), 420)
+        self.assertEquals(self.obj.passInOutDouble_(0.01), 0.42)
 
     def testCharpIn(self):
         self.assertEquals(self.obj.passInCharp_("hello"), "hheelllloo")
 
     def testCharpOut(self):
         self.obj.reset()
-        self.assertEquals(self.obj.passOutCharp_(), (None, "hello"))
-        self.assertEquals(self.obj.passOutCharp_(), (None, "world"))
-        self.assertEquals(self.obj.passOutCharp_(), (None, "foobar"))
+        self.assertEquals(self.obj.passOutCharp_(), "hello")
+        self.assertEquals(self.obj.passOutCharp_(), "world")
+        self.assertEquals(self.obj.passOutCharp_(), "foobar")
 
     def testCharpInOut(self):
-        self.assertEquals(self.obj.passInOutCharp_("hello"), (None, "hheelllloo"))
-        self.assertEquals(self.obj.passInOutCharp_("abcdef"), (None, "aabbccddeeff"))
+        self.assertEquals(self.obj.passInOutCharp_("hello"), "hheelllloo")
+        self.assertEquals(self.obj.passInOutCharp_("abcdef"), "aabbccddeeff")
 
     # TODO: structs (including Objective-C part)
 

File pyobjc/Lib/objc/test/test_methods2.py

 import unittest
 import objc
 from objc import YES, NO, nil
-from Foundation import NSPriorDayDesignations 
+from Foundation import NSPriorDayDesignations
 import sys
 
 NSArray = objc.runtime.NSArray
 		self.assert_(o is not None)
 		o.reset()
 		r = o.BOOLOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], YES)
+		self.assertEquals(r, YES)
 		r = o.BOOLOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], NO)
+		self.assertEquals(r, NO)
 
 
 	def testcharOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.charOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -128)
+		self.assertEquals(r, -128)
 		r = o.charOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.charOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 127)
+		self.assertEquals(r, 127)
 
 
 	def testsignedshortOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.signedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<14))
+		self.assertEquals(r, -(1<<14))
 		r = o.signedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = o.signedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.signedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.signedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 14)
+		self.assertEquals(r, 1 << 14)
 
 
 	def testsignedintOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.signedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<30))
+		self.assertEquals(r, -(1<<30))
 		r = o.signedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = o.signedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.signedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.signedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testsignedlongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.signedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<30))
+		self.assertEquals(r, -(1<<30))
 		r = o.signedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = o.signedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.signedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.signedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testsignedlonglongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.signedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1L << 60))
+		self.assertEquals(r, -(1L << 60))
 		r = o.signedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = o.signedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.signedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.signedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 60)
+		self.assertEquals(r, 1L << 60)
 
 
 	def testunsignedcharOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.unsignedcharOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.unsignedcharOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 128)
+		self.assertEquals(r, 128)
 		r = o.unsignedcharOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 255)
+		self.assertEquals(r, 255)
 
 
 	def testunsignedshortOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.unsignedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.unsignedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.unsignedshortOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1<<14)
+		self.assertEquals(r, 1<<14)
 
 
 	def testunsignedintOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.unsignedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.unsignedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.unsignedintOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testunsignedlongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.unsignedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.unsignedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.unsignedlongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 30)
+		self.assertEquals(r, 1L << 30)
 
 
 	def testunsignedlonglongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.unsignedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = o.unsignedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = o.unsignedlonglongOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 62)
+		self.assertEquals(r, 1L << 62)
 
 
 	def testfloatOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.floatOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 0.128)
+		self.assertAlmostEquals(r, 0.128)
 		r = o.floatOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1.0)
+		self.assertAlmostEquals(r, 1.0)
 		r = o.floatOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 42.0)
+		self.assertAlmostEquals(r, 42.0)
 		r = o.floatOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1e10)
+		self.assertAlmostEquals(r, 1e10)
 
 
 	def testdoubleOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.doubleOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 0.128)
+		self.assertAlmostEquals(r, 0.128)
 		r = o.doubleOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1.0)
+		self.assertAlmostEquals(r, 1.0)
 		r = o.doubleOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 42.0)
+		self.assertAlmostEquals(r, 42.0)
 		r = o.doubleOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1e10)
+		self.assertAlmostEquals(r, 1e10)
 
 
 	def testidOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.idOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], NSPriorDayDesignations)
+		self.assertEquals(r, NSPriorDayDesignations)
 
 
 	def testcharPtrOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.charPtrOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "hello")
+		self.assertEquals(r, "hello")
 		r = o.charPtrOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "world")
+		self.assertEquals(r, "world")
 		r = o.charPtrOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "foobar")
+		self.assertEquals(r, "foobar")
 
 
 	def testNSPointOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.NSPointOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], (1, 2))
+		self.assertEquals(r, (1, 2))
 		r = o.NSPointOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], (3, 4))
+		self.assertEquals(r, (3, 4))
 
 
 	def testNSRectOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = o.NSRectOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], ((1, 2), (3, 4)))
+		self.assertEquals(r, ((1, 2), (3, 4)))
 		r = o.NSRectOutArg_()
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], ((7, 8), (9, 10)))
-
-
-	# Pass by reference arguments (out)
+		self.assertEquals(r, ((7, 8), (9, 10)))
+
+
+	# Pass by reference arguments (inout)
 
 	def testBOOLInOut(self):
 		o = PyObjC_TestClass1.alloc().init()
 		if (self.counter > 2): self.reset()
 		res = g_BOOL_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	BOOLOutArg_ = objc.selector(BOOLOutArg_, signature="v@:o^c")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_char_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	charOutArg_ = objc.selector(charOutArg_, signature="v@:o^c")
 
 
 		if (self.counter > 5): self.reset()
 		res = g_signedshort_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	signedshortOutArg_ = objc.selector(signedshortOutArg_, signature="v@:o^s")
 
 
 		if (self.counter > 5): self.reset()
 		res = g_signedint_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	signedintOutArg_ = objc.selector(signedintOutArg_, signature="v@:o^i")
 
 
 		if (self.counter > 5): self.reset()
 		res = g_signedlong_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	signedlongOutArg_ = objc.selector(signedlongOutArg_, signature="v@:o^l")
 
 
 		if (self.counter > 5): self.reset()
 		res = g_signedlonglong_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	signedlonglongOutArg_ = objc.selector(signedlonglongOutArg_, signature="v@:o^q")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_unsignedchar_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	unsignedcharOutArg_ = objc.selector(unsignedcharOutArg_, signature="v@:o^C")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_unsignedshort_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	unsignedshortOutArg_ = objc.selector(unsignedshortOutArg_, signature="v@:o^S")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_unsignedint_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	unsignedintOutArg_ = objc.selector(unsignedintOutArg_, signature="v@:o^I")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_unsignedlong_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	unsignedlongOutArg_ = objc.selector(unsignedlongOutArg_, signature="v@:o^L")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_unsignedlonglong_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	unsignedlonglongOutArg_ = objc.selector(unsignedlonglongOutArg_, signature="v@:o^Q")
 
 
 		if (self.counter > 4): self.reset()
 		res = g_float_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	floatOutArg_ = objc.selector(floatOutArg_, signature="v@:o^f")
 
 
 		if (self.counter > 4): self.reset()
 		res = g_double_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	doubleOutArg_ = objc.selector(doubleOutArg_, signature="v@:o^d")
 
 
 		if (self.counter > 1): self.reset()
 		res = g_id_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	idOutArg_ = objc.selector(idOutArg_, signature="v@:o^@")
 
 
 		if (self.counter > 3): self.reset()
 		res = g_charPtr_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	charPtrOutArg_ = objc.selector(charPtrOutArg_, signature="v@:o^*")
 
 
 		if (self.counter > 2): self.reset()
 		res = g_NSPoint_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	NSPointOutArg_ = objc.selector(NSPointOutArg_, signature="v@:o^{_NSPoint=ff}")
 
 
 		if (self.counter > 2): self.reset()
 		res = g_NSRect_values[self.counter]
 		self.counter += 1
-		return (None, res)
+		return res
 	NSRectOutArg_ = objc.selector(NSRectOutArg_, signature="v@:o^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
 
 
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callBOOLOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], YES)
+		self.assertEquals(r, YES)
 		r = PyObjC_TestClass2.callBOOLOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], NO)
+		self.assertEquals(r, NO)
 
 
 	def testinvokeBOOLOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeBOOLOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], YES)
+		self.assertEquals(r, YES)
 		r = PyObjC_TestClass2.invokeBOOLOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], NO)
+		self.assertEquals(r, NO)
 
 
 	def testcallcharOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -128)
+		self.assertEquals(r, -128)
 		r = PyObjC_TestClass2.callcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 127)
+		self.assertEquals(r, 127)
 
 
 	def testinvokecharOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokecharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -128)
+		self.assertEquals(r, -128)
 		r = PyObjC_TestClass2.invokecharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokecharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 127)
+		self.assertEquals(r, 127)
 
 
 	def testcallsignedshortOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<14))
+		self.assertEquals(r, -(1<<14))
 		r = PyObjC_TestClass2.callsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.callsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 14)
+		self.assertEquals(r, 1 << 14)
 
 
 	def testinvokesignedshortOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokesignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<14))
+		self.assertEquals(r, -(1<<14))
 		r = PyObjC_TestClass2.invokesignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.invokesignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokesignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokesignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 14)
+		self.assertEquals(r, 1 << 14)
 
 
 	def testcallsignedintOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<30))
+		self.assertEquals(r, -(1<<30))
 		r = PyObjC_TestClass2.callsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.callsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testinvokesignedintOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokesignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<30))
+		self.assertEquals(r, -(1<<30))
 		r = PyObjC_TestClass2.invokesignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.invokesignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokesignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokesignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testcallsignedlongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<30))
+		self.assertEquals(r, -(1<<30))
 		r = PyObjC_TestClass2.callsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.callsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testinvokesignedlongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokesignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1<<30))
+		self.assertEquals(r, -(1<<30))
 		r = PyObjC_TestClass2.invokesignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.invokesignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokesignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokesignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testcallsignedlonglongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1L << 60))
+		self.assertEquals(r, -(1L << 60))
 		r = PyObjC_TestClass2.callsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.callsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 60)
+		self.assertEquals(r, 1L << 60)
 
 
 	def testinvokesignedlonglongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokesignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -(1L << 60))
+		self.assertEquals(r, -(1L << 60))
 		r = PyObjC_TestClass2.invokesignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], -42)
+		self.assertEquals(r, -42)
 		r = PyObjC_TestClass2.invokesignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokesignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokesignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 60)
+		self.assertEquals(r, 1L << 60)
 
 
 	def testcallunsignedcharOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callunsignedcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callunsignedcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 128)
+		self.assertEquals(r, 128)
 		r = PyObjC_TestClass2.callunsignedcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 255)
+		self.assertEquals(r, 255)
 
 
 	def testinvokeunsignedcharOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeunsignedcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokeunsignedcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 128)
+		self.assertEquals(r, 128)
 		r = PyObjC_TestClass2.invokeunsignedcharOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 255)
+		self.assertEquals(r, 255)
 
 
 	def testcallunsignedshortOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callunsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callunsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callunsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1<<14)
+		self.assertEquals(r, 1<<14)
 
 
 	def testinvokeunsignedshortOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeunsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokeunsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokeunsignedshortOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1<<14)
+		self.assertEquals(r, 1<<14)
 
 
 	def testcallunsignedintOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callunsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callunsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callunsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testinvokeunsignedintOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeunsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokeunsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokeunsignedintOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1 << 30)
+		self.assertEquals(r, 1 << 30)
 
 
 	def testcallunsignedlongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callunsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callunsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callunsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 30)
+		self.assertEquals(r, 1L << 30)
 
 
 	def testinvokeunsignedlongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeunsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokeunsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokeunsignedlongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 30)
+		self.assertEquals(r, 1L << 30)
 
 
 	def testcallunsignedlonglongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callunsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.callunsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.callunsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 62)
+		self.assertEquals(r, 1L << 62)
 
 
 	def testinvokeunsignedlonglongOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeunsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 0)
+		self.assertEquals(r, 0)
 		r = PyObjC_TestClass2.invokeunsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 42)
+		self.assertEquals(r, 42)
 		r = PyObjC_TestClass2.invokeunsignedlonglongOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], 1L << 62)
+		self.assertEquals(r, 1L << 62)
 
 
 	def testcallfloatOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callfloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 0.128)
+		self.assertAlmostEquals(r, 0.128)
 		r = PyObjC_TestClass2.callfloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1.0)
+		self.assertAlmostEquals(r, 1.0)
 		r = PyObjC_TestClass2.callfloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 42.0)
+		self.assertAlmostEquals(r, 42.0)
 		r = PyObjC_TestClass2.callfloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1e10)
+		self.assertAlmostEquals(r, 1e10)
 
 
 	def testinvokefloatOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokefloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 0.128)
+		self.assertAlmostEquals(r, 0.128)
 		r = PyObjC_TestClass2.invokefloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1.0)
+		self.assertAlmostEquals(r, 1.0)
 		r = PyObjC_TestClass2.invokefloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 42.0)
+		self.assertAlmostEquals(r, 42.0)
 		r = PyObjC_TestClass2.invokefloatOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1e10)
+		self.assertAlmostEquals(r, 1e10)
 
 
 	def testcalldoubleOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.calldoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 0.128)
+		self.assertAlmostEquals(r, 0.128)
 		r = PyObjC_TestClass2.calldoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1.0)
+		self.assertAlmostEquals(r, 1.0)
 		r = PyObjC_TestClass2.calldoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 42.0)
+		self.assertAlmostEquals(r, 42.0)
 		r = PyObjC_TestClass2.calldoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1e10)
+		self.assertAlmostEquals(r, 1e10)
 
 
 	def testinvokedoubleOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokedoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 0.128)
+		self.assertAlmostEquals(r, 0.128)
 		r = PyObjC_TestClass2.invokedoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1.0)
+		self.assertAlmostEquals(r, 1.0)
 		r = PyObjC_TestClass2.invokedoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 42.0)
+		self.assertAlmostEquals(r, 42.0)
 		r = PyObjC_TestClass2.invokedoubleOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertAlmostEquals(r[1], 1e10)
+		self.assertAlmostEquals(r, 1e10)
 
 
 	def testcallidOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callidOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], NSPriorDayDesignations)
+		self.assertEquals(r, NSPriorDayDesignations)
 
 
 	def testinvokeidOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeidOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], NSPriorDayDesignations)
+		self.assertEquals(r, NSPriorDayDesignations)
 
 
 	def testcallcharPtrOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callcharPtrOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "hello")
+		self.assertEquals(r, "hello")
 		r = PyObjC_TestClass2.callcharPtrOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "world")
+		self.assertEquals(r, "world")
 		r = PyObjC_TestClass2.callcharPtrOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "foobar")
+		self.assertEquals(r, "foobar")
 
 
 	def testinvokecharPtrOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokecharPtrOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "hello")
+		self.assertEquals(r, "hello")
 		r = PyObjC_TestClass2.invokecharPtrOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "world")
+		self.assertEquals(r, "world")
 		r = PyObjC_TestClass2.invokecharPtrOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], "foobar")
+		self.assertEquals(r, "foobar")
 
 
 	def testcallNSPointOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callNSPointOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], (1, 2))
+		self.assertEquals(r, (1, 2))
 		r = PyObjC_TestClass2.callNSPointOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], (3, 4))
+		self.assertEquals(r, (3, 4))
 
 
 	def testinvokeNSPointOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeNSPointOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], (1, 2))
+		self.assertEquals(r, (1, 2))
 		r = PyObjC_TestClass2.invokeNSPointOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], (3, 4))
+		self.assertEquals(r, (3, 4))
 
 
 	def testcallNSRectOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.callNSRectOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], ((1, 2), (3, 4)))
+		self.assertEquals(r, ((1, 2), (3, 4)))
 		r = PyObjC_TestClass2.callNSRectOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], ((7, 8), (9, 10)))
+		self.assertEquals(r, ((7, 8), (9, 10)))
 
 
 	def testinvokeNSRectOut(self):
 		self.assert_(o is not None)
 		o.reset()
 		r = PyObjC_TestClass2.invokeNSRectOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], ((1, 2), (3, 4)))
+		self.assertEquals(r, ((1, 2), (3, 4)))
 		r = PyObjC_TestClass2.invokeNSRectOutArg_of_(o)
-		self.assertEquals(r[0], None)
-		self.assertEquals(r[1], ((7, 8), (9, 10)))
+		self.assertEquals(r, ((7, 8), (9, 10)))
 
 
 	# Pass by reference arguments (out)

File pyobjc/Modules/Foundation/_FoundationMapping_NSCoder.m

 {
 	char* signature;
 	PyObject* value;
-	PyObject* result;
 	void*     buf;
 	int    size;
 	struct objc_super super;
 		return NULL;
 	}
 
-	result = PyTuple_New(2);
-	if (result == NULL) {
-		Py_DECREF(value);
-		return NULL;
-	}
-
-	PyTuple_SET_ITEM(result, 0, Py_None);
-	Py_INCREF(Py_None);
-	PyTuple_SET_ITEM(result, 1, value);
-
-	return result;
+	return value;
 }
 
 static void imp_NSCoder_decodeValueOfObjCType_at_(id self, SEL sel,
 {
 	PyObject* result;
 	PyObject* arglist;
-	PyObject* seq;
 	int err;
 
 	arglist = PyTuple_New(1);
 		return;
 	}
 
-	seq = PySequence_Fast(result, "Must return a sequence of length 2");
-	if (seq == NULL) {
-		Py_DECREF(result);
+	err = PyObjC_PythonToObjC(signature, result, buf);
+	Py_DECREF(result);
+
+	if (err == -1) {
 		PyObjCErr_ToObjC();
 		return;
 	}
-	Py_DECREF(result);
-
-	if (PySequence_Fast_GET_SIZE(seq) != 2) {
-		Py_DECREF(seq);
-		PyErr_SetString(PyExc_TypeError,
-			"Must return a sequence of length 2");
-		Py_DECREF(seq);
-		PyObjCErr_ToObjC();
-		return;
-	}
-
-	if (PySequence_Fast_GET_ITEM(seq, 0) != Py_None) {
-		PyErr_SetString(PyExc_TypeError,
-			"returnvalue[0] must be Py_None");
-		Py_DECREF(seq);
-		PyObjCErr_ToObjC();
-		return;
-	}
-
-	err = PyObjC_PythonToObjC(signature, 
-		PySequence_Fast_GET_ITEM(seq, 1), buf);
-	if (err == -1) {
-		Py_DECREF(seq);
-		PyObjCErr_ToObjC();
-		return;
-	}
-
-	Py_DECREF(seq);
 }
 
 static PyObject* call_NSCoder_decodeArrayOfObjCType_count_at_(

File pyobjc/Modules/Foundation/_FoundationMapping_NSString.m

 		return NULL;
 	}
 	
-	res = PyTuple_New(3);
+	res = PyTuple_New(2);
 	if (res == NULL) {
 		free(buf);
 		return NULL;
 	}
 
-	PyTuple_SET_ITEM(res, 0, Py_None);
-	Py_INCREF(Py_None);
-
-	PyTuple_SET_ITEM(res, 1, PyString_FromString(buf));
+	PyTuple_SET_ITEM(res, 0, PyString_FromString(buf));
 	free(buf);
 	if (PyErr_Occurred()) {
 		Py_DECREF(res);
 		return NULL;
 	}
 
-	PyTuple_SET_ITEM(res, 2, rangeObj);
+	PyTuple_SET_ITEM(res, 1, rangeObj);
 	return res;
 }
 
 		return NULL;
 	}
 	
-	res = PyTuple_New(2);
+	res = PyString_FromString(buf);
+	free(buf);
 	if (res == NULL) {
-		free(buf);
-		return NULL;
-	}
-
-	PyTuple_SET_ITEM(res, 0, Py_None);
-	Py_INCREF(Py_None);
-
-	PyTuple_SET_ITEM(res, 1, PyString_FromString(buf));
-	free(buf);
-	if (PyErr_Occurred()) {
-		Py_DECREF(res);
-		free(buf);
 		return NULL;
 	}
 

File pyobjc/Modules/objc/class-builder.m

 		int idx;
 		PyObject* real_res;
 
-		if (!PyTuple_Check(result) 
-				|| PyTuple_Size(result) != have_output+1) {
-			ObjCErr_Set(PyExc_TypeError,
-				"%s: Need tuple of %d arguments as result",
-				SELNAME([invocation selector]), have_output+1);
+		if (*type == _C_VOID && have_output == 1) {
+			/* One output argument, and a 'void' return value,
+			 * the python method returned just the output
+			 * argument
+			 */
+			/* This should be cleaned up, unnecessary code
+			 * duplication
+			 */
+
+			for (i = 2; i < len;i++) {
+				void* ptr;
+				type = [signature getArgumentTypeAtIndex:i];
+
+				if (arglen == -1) {
+					PyObjCErr_ToObjC();
+					return;
+				}
+
+				switch (*type) {
+				case _C_PTR:
+					type ++;
+					break;
+				case _C_INOUT: case _C_OUT:
+					if (type[1] != _C_PTR) {
+						continue;
+					}
+					type += 2;
+					break;
+				default:
+					continue;
+				}
+
+				[invocation getArgument:&ptr atIndex:i];
+				err = depythonify_c_value(type, result, ptr);
+				if (err == -1) {
+					PyObjCErr_ToObjC();
+				}
+				if (v->ob_refcnt == 1 && type[0] == _C_ID) {
+					/* make sure return value doesn't die before
+					 * the caller can get its hands on it.
+					 */
+					[[*(id*)ptr retain] autorelease];
+				}
+
+				/* We have exactly 1 output argument */
+				break;
+
+			}
+
 			Py_DECREF(result);
-			PyObjCErr_ToObjC();
 			return;
 		}
 
-		real_res = PyTuple_GET_ITEM(result, 0);
-		if (*type  != _C_VOID && *type != _C_ONEWAY) {
+		if (*type != _C_VOID) {
+			if (!PyTuple_Check(result) 
+			     || PyTuple_Size(result) != have_output+1) {
+				ObjCErr_Set(PyExc_TypeError,
+					"%s: Need tuple of %d arguments as result",
+					SELNAME([invocation selector]),
+					have_output+1);
+				Py_DECREF(result);
+				PyObjCErr_ToObjC();
+				return;
+			}
+			idx = 1;
+			real_res = PyTuple_GET_ITEM(result, 0);
+
 			arg = alloca(arglen+1);
 
 			err = depythonify_c_value(type, real_res, arg);
 				return;
 			}
 			[invocation setReturnValue:arg];
+
+		} else {
+			if (!PyTuple_Check(result) 
+			     || PyTuple_Size(result) != have_output) {
+				ObjCErr_Set(PyExc_TypeError,
+					"%s: Need tuple of %d arguments as result",
+					SELNAME([invocation selector]),
+					have_output);
+				Py_DECREF(result);
+				PyObjCErr_ToObjC();
+				return;
+			}
+			idx = 0;
 		}
-		idx = 1;
+
 
 		for (i = 2; i < len;i++) {
 			void* ptr;

File pyobjc/Modules/objc/libffi_support.m

 		const char* argtype = [methinfo getArgumentTypeAtIndex:i];
 
 		switch (*argtype) {
-#if 0
-/* Unannotated pointers should be handled by pointer-support.m */
-		case _C_PTR:
-			have_output ++;
-			v = pythonify_c_value(argtype+1, *(void**)args[i+argOffset]);
-			break;
-#endif
 		case _C_INOUT: 
 			if (argtype[1] == _C_PTR) {
 				have_output ++;
 		int idx;
 		PyObject* real_res;
 
-		if (!PyTuple_Check(res) || PyTuple_Size(res) != have_output+1) {
-			ObjCErr_Set(PyExc_TypeError,
-				"%s: Need tuple of %d arguments as result",
-				SELNAME(*(SEL*)args[1]), have_output+1);
-			Py_DECREF(res);
-			PyObjCErr_ToObjC();
+		if (*rettype == _C_VOID && have_output == 1) {
+			/* Special case: the python method returned only
+			 * the return value, not a tuple.
+			 */
+			for (i = 2; i < objc_argcount; i++) {
+				const char* argtype = [methinfo 
+					getArgumentTypeAtIndex:i];
+				int err;
+
+				switch (*argtype) {
+				case _C_INOUT: case _C_OUT:
+					if (argtype[1] != _C_PTR) {
+						continue;
+					}
+					argtype += 2;
+					break;
+				default: continue;
+				}
+
+				err = depythonify_c_value(argtype, res, *(void**)args[i]);
+				if (err == -1) {
+					PyObjCErr_ToObjC();
+				}
+				if (v->ob_refcnt == 1 && argtype[0] == _C_ID) {
+					/* make sure return value doesn't die before
+					 * the caller can get its hands on it.
+					 */
+					[[**(id**)args[i] retain] autorelease];
+				}
+
+				break;
+			}
+
+			return;
 		}
 
-		real_res = PyTuple_GET_ITEM(res, 0);
-		idx = 1;
+		if (*rettype != _C_VOID) {
+			if (!PyTuple_Check(res) || PyTuple_Size(res) != have_output+1) {
+				ObjCErr_Set(PyExc_TypeError,
+					"%s: Need tuple of %d arguments as result",
+					SELNAME(*(SEL*)args[1]), have_output+1);
+				Py_DECREF(res);
+				PyObjCErr_ToObjC();
+			}
+
+			real_res = PyTuple_GET_ITEM(res, 0);
+			idx = 1;
+		} else {
+			if (!PyTuple_Check(res) || PyTuple_Size(res) != have_output) {
+				ObjCErr_Set(PyExc_TypeError,
+					"%s: Need tuple of %d arguments as result",
+					SELNAME(*(SEL*)args[1]), have_output);
+				Py_DECREF(res);
+				PyObjCErr_ToObjC();
+			}
+			real_res = NULL;
+			idx = 0;
+		}
+
+
 		for (i = 2; i < objc_argcount; i++) {
 			const char* argtype = [methinfo 
 				getArgumentTypeAtIndex:i];
 			int err;
 
 			switch (*argtype) {
-#if 0
-/* Unannotated pointers should be handled by pointer-support.m */
-			case _C_PTR: 
-				argtype ++;
-				break;
-#endif
 			case _C_INOUT: case _C_OUT:
 				if (argtype[1] != _C_PTR) {
 					continue;
 		}
 
 		if (*rettype != _C_VOID) {
-			int err = depythonify_c_return_value(rettype, real_res, resp);
+			int err = depythonify_c_return_value(rettype, 
+				real_res, resp);
 
 			if (*rettype == _C_ID && real_res->ob_refcnt == 1) {
 				/* make sure return value doesn't die before
 		const char *argtype = [methinfo getArgumentTypeAtIndex:i];
 
 		switch (*argtype) {
-#if 0
-/* Unannotated pointers should be handled by pointer-support.m */
-		case _C_PTR: 
-			byref_in_count ++;
-			byref_out_count ++;
-			itemSize = objc_sizeof_type(argtype+1);
-			itemAlign = objc_alignof_type(argtype+1);
-			if (itemSize == -1) {
-				return NULL;
-			}
-			argbuf_len = align(argbuf_len, itemAlign);
-			argbuf_len += itemSize;
-			break;
-#endif
 		case _C_INOUT:
 			if (argtype[1] == _C_PTR) {
 				byref_out_count ++;
 					values[arglistOffset + i] = arg;
 				} 
 				break;
-#if 0
-/* Unannotated pointers should be handled by pointer-support.m */
-			case _C_PTR:
-				/* Allocate space and encode */
-				{
-					argbuf_cur = align(argbuf_cur, 
-						objc_alignof_type(argtype+1));
-					arg = argbuf + argbuf_cur;
-					argbuf_cur += objc_sizeof_type(argtype+1);
-					byref[i] = arg;
-	  				error = depythonify_c_value (
-						argtype+1, 
-						argument, 
-						arg);
-
-					arglist[arglistOffset + i] = &ffi_type_pointer;
-					values[arglistOffset + i] = byref+i;
-				} 
-				break;
-#endif
 			case _C_INOUT:
 			case _C_IN:
 			case _C_CONST:
 	if (byref_out_count == 0) {
 		result = objc_result;
 	} else {
-		result = PyTuple_New(byref_out_count+1);
-		if (result == 0) goto error_cleanup;
 
-		if (PyTuple_SetItem(result, 0, objc_result) < 0) {
-			goto error_cleanup;
+		if (*rettype == _C_VOID) {
+			if (byref_out_count > 1) {
+				result = PyTuple_New(byref_out_count);
+				if (result == 0) goto error_cleanup;
+			} else {
+				result = NULL;
+			}
+			Py_DECREF(objc_result);
+			py_arg = 0;
+		} else {
+			result = PyTuple_New(byref_out_count+1);
+			if (result == 0) goto error_cleanup;
+			if (PyTuple_SetItem(result, 0, objc_result) < 0) {
+				goto error_cleanup;
+			}
+			py_arg = 1;
 		}
 		objc_result = NULL;
 
-		py_arg = 1;
 		for (i = 2; i < objc_argcount; i++) {
 			const char *argtype = [methinfo 
 						getArgumentTypeAtIndex:i];
 			PyObject*   v;
 
 			switch (*argtype) {
-#if 0
-/* Unannotated pointers should be handled by pointer-support.m */
-			case _C_PTR: 
-				arg = byref[i];
-				v = pythonify_c_value(argtype+1, arg);
-				if (!v) goto error_cleanup;
-				if (PyTuple_SetItem(result, py_arg++, v) < 0) {
-					Py_DECREF(v);
-					goto error_cleanup;
-				}
-				break;
-#endif
 			case _C_INOUT:
 			case _C_OUT:
 				if (argtype[1] == _C_PTR) {
 					arg = byref[i];
 					v = pythonify_c_value(argtype+2, arg);
 					if (!v) goto error_cleanup;
-					if (PyTuple_SetItem(result, 
+
+					if (result != NULL) {
+						if (PyTuple_SetItem(result, 
 							py_arg++, v) < 0) {
-						Py_DECREF(v);
-						goto error_cleanup;
+
+							Py_DECREF(v);
+							goto error_cleanup;
+						}
+					} else {
+						result = v;
 					}
 				}
 				break;

File pyobjc/Modules/objc/objc-object.m

  * pickle). This method forces a failure during pickling.
  */
 static PyObject*
-meth_reduce(PyObject* self)
+meth_reduce(PyObject* self __attribute__((__unused__)))
 {
         PyErr_SetString(PyExc_TypeError,
 		"Cannot pickle Objective-C objects");

File pyobjc/Modules/objc/objc_support.m

 		}
 
 		ObjCErr_Set(PyExc_ValueError,
-			"depythonifying '%s', got '%s' of %d",
+			"depythonifying '%s', got '%s'",