Commits

Ronald Oussoren committed d745c73

- Remove the experimantal performance improvement, it doesn't really work.
- Some documentation cleanup
- Fix NSEndSheetMethod -> endSheetMethod + fix implementation
- The Python interpreter tries to access a number of special attributes during
normal operation, such as subclassing. This caused an unnecessary methodscan
for lots of classes, special-case those methods. This significantly speeds
up "python -c 'import AppKit'" (30% faster).

Comments (0)

Files changed (20)

pyobjc/Doc/api-notes-macosx.html

 use <code><span>AppKit.NSMakeRect(x,</span> <span>y,</span> <span>h,</span> <span>w)</span></code>.</p>
 <p>The callback methods for the NSSheet API's have a non-default signature
 and no fixed name. You should therefore explicitly specify the signature. This
-is done by calling the <code><span>NSEndSheetMethod</span></code> function after defining your
+is done by calling the <code><span>endSheetMethod</span></code> function after defining your
 callback:</p>
 <pre>
 class MYClass (NSObject):
                 &quot;&quot;&quot; Actual implementation goes here &quot;&quot;&quot;
                 pass
 
-        mysheetDidEnd = NSEndSheetMethod(mysheetDidEnd)
+        mysheetDidEnd = AppKit.endSheetMethod(mysheetDidEnd)
 </pre>
 <h3><a href="#id7" name="class-nsapplication">Class NSApplication</a></h3>
 <p><code><span>NSModalSession</span></code> objects are wrapped as opaque values. You can check if

pyobjc/Doc/api-notes-macosx.txt

 
 The callback methods for the NSSheet API's have a non-default signature
 and no fixed name. You should therefore explicitly specify the signature. This
-is done by calling the ``NSEndSheetMethod`` function after defining your
+is done by calling the ``endSheetMethod`` function after defining your
 callback::
 	
 	class MYClass (NSObject):
 			""" Actual implementation goes here """
 			pass
 
-		mysheetDidEnd = NSEndSheetMethod(mysheetDidEnd)
+		mysheetDidEnd = AppKit.endSheetMethod(mysheetDidEnd)
 
 
 Class NSApplication

pyobjc/Doc/coding-style.html

 <li>Add appropriate ReST style fields to the top of the document as comments:<pre>
 # Author: David Goodger
 # Contact: goodger@users.sourceforge.net
-# Revision: $Revision: 1.9 $
-# Date: $Date: 2003/06/20 18:30:27 $
+# Revision: $Revision: 1.10 $
+# Date: $Date: 2003/06/21 18:40:44 $
 # Copyright: This module has been placed in the public domain.
 </pre>
 </li>

pyobjc/Doc/index.html

 <h2>PyObjC documentation index</h2>
 <p>PyObjC is a bridge between Python and Objective-C. It allows you to write
 Python scripts that use and extend existing Objective-C class libraries,
-most importantly the <a href="#cocoa-libraries">Cocoa libraries</a> by <a href="http://www.apple.com/">Apple</a>.</p>
-<blockquote>
-<p><a id="cocoa-libraries" name="cocoa-libraries">Cocoa libraries</a>:  <a href="http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html">http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html</a></p>
-</blockquote>
-<h2><a name="general-documentation">General documentation</a></h2>
-<p>NOTE: There's a lot of duplication between the first 3 of these.</p>
+most importantly the <a href="http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html">Cocoa libraries</a> by <a href="http://www.apple.com/">Apple</a>.</p>
+<h2><a name="general-user-documentation">General user documentation</a></h2>
+<p>The following documents are usefull when you're interested in developing
+Cocoa applications in Python.</p>
 <ul>
-<li><a href="intro.html">An introduction to PyObjC</a></li>
-<li><a href="users.html">Userguide for PyObjC</a></li>
-<li><a href="classes.html">Python classes and Objective-C code</a></li>
-<li><a href="api-notes-macosx.txt">Notes on supported APIs and classes on MacOS X</a></li>
+<li><a href="intro.html">An introduction to PyObjC</a><p>An overview of the PyObjC package and how to use it. Read this before
+you start using the package, it will help you to avoid some surprises.</p>
+</li>
+<li><a href="users.html">Userguide for PyObjC</a><p>An older overview of PyObjC.</p>
+</li>
+<li><a href="classes.html">Python classes and Objective-C code</a><p>Another older overview of PyObjC.</p>
+</li>
+<li><a href="api-notes-macosx.txt">Notes on supported APIs and classes on MacOS X</a><p>This document lists the methods and classes that are not fully supported,
+or supported in an 'unexpected' way.</p>
+</li>
 </ul>
 <h2><a name="tutorials">Tutorials</a></h2>
 <ul>
-<li><a href="tutorial/tutorial.html">Creating your first PyObjC application (tutorial)</a></li>
+<li><a href="tutorial/tutorial.html">Creating your first PyObjC application (tutorial)</a><p>This tutorial guides you though creating a Python based Cocoa application.</p>
+</li>
+<li><a href="tutorial_embed/extending_objc_with_python.html">Adding Python code to an existing ObjC application</a><p>This tutorial teaches you how to extend you existing Objective-C based
+Cocoa application using Python.</p>
+</li>
 </ul>
 <h2><a name="examples">Examples</a></h2>
+<p>The source tree includes a number of examples, see the <a href="../Examples/00ReadMe.html">list of examples</a> for
+more information.</p>
+<h2><a name="technical-documentation">Technical documentation</a></h2>
+<p>These documents are only relevant if you want to modify PyObjC, not if
+you want to write Cocoa programs in Python.</p>
 <ul>
-<li><a href="../Examples/00ReadMe.html">List of examples</a></li>
-</ul>
-<h2><a name="technical-documentation">Technical documentation</a></h2>
-<ul>
-<li><a href="coding-style.html">Coding style for PyObjC</a></li>
-<li><a href="libffi.html">Using LibFFI with PyObjC</a></li>
-<li><a href="architecture.html">PyObjC Architecture</a></li>
-<li><a href="structure.html">Structure of the PyObjC package</a></li>
-<li><a href="wrapping.html">How to wrap an Objective-C class library</a></li>
-<li><a href="warts.html">Odd features</a></li>
+<li><a href="coding-style.html">Coding style for PyObjC</a><p>Rules for formatting code and documentation.</p>
+</li>
+<li><a href="architecture.html">PyObjC Architecture</a><p>An overview of the PyObjC architecture. This document is out of date.</p>
+</li>
+<li><a href="structure.html">Structure of the PyObjC package</a><p>Another overview of the PyObjC package.</p>
+</li>
+<li><a href="wrapping.html">How to wrap an Objective-C class library</a><p>This explains how you can provide a python wrapper for an existing 
+Objective-C class library.</p>
+</li>
+<li><a href="warts.html">Odd features</a><p>Describes some features of Objective-C that may surprise Python programmers.
+Not very relevant.</p>
+</li>
+<li><a href="ProjectBuilder-SyntaxHighlighting.html">Project Builder Python Support</a><p>Describes the Python support for Project Builder, including a TODO list for
+future versions.</p>
+</li>
 </ul>
 </body>
 </html>

pyobjc/Doc/index.txt

 
 .. _`Apple`: http://www.apple.com/
 
-   _`Cocoa libraries`:  http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html 
+.. _`Cocoa libraries`:  http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html 
 
-General documentation
-.....................
+General user documentation
+..........................
 
-NOTE: There's a lot of duplication between the first 3 of these.
+The following documents are usefull when you're interested in developing
+Cocoa applications in Python.
 
 * `An introduction to PyObjC`_
 
+  An overview of the PyObjC package and how to use it. Read this before
+  you start using the package, it will help you to avoid some surprises.
+
 * `Userguide for PyObjC`_
 
+  An older overview of PyObjC. 
+
 * `Python classes and Objective-C code`_
 
+  Another older overview of PyObjC. 
+
 * `Notes on supported APIs and classes on MacOS X`_
 
+  This document lists the methods and classes that are not fully supported,
+  or supported in an 'unexpected' way.
+
 Tutorials
 .........
 
 * `Creating your first PyObjC application (tutorial)`_
 
+  This tutorial guides you though creating a Python based Cocoa application.
+
+* `Adding Python code to an existing ObjC application`_
+
+  This tutorial teaches you how to extend you existing Objective-C based
+  Cocoa application using Python.
+
 Examples
 ........
 
-
-* `List of examples`__
+The source tree includes a number of examples, see the `list of examples`__ for
+more information.
 
 .. __: ../Examples/00ReadMe.html
 
 
-
 Technical documentation
 .......................
 
+These documents are only relevant if you want to modify PyObjC, not if
+you want to write Cocoa programs in Python.
+
 * `Coding style for PyObjC`_
 
-* `Using LibFFI with PyObjC`_
+  Rules for formatting code and documentation.
 
 * `PyObjC Architecture`_
 
+  An overview of the PyObjC architecture. This document is out of date.
+
 * `Structure of the PyObjC package`_
 
+  Another overview of the PyObjC package.
+
 * `How to wrap an Objective-C class library`_
 
+  This explains how you can provide a python wrapper for an existing 
+  Objective-C class library.
+
 * `Odd features`_
 
-..   _`An introduction to PyObjC`: intro.html
+  Describes some features of Objective-C that may surprise Python programmers.
+  Not very relevant.
 
-..   _`Userguide for PyObjC`: users.html
+* `Project Builder Python Support`_
 
-..   _`Python classes and Objective-C code`: classes.html
+  Describes the Python support for Project Builder, including a TODO list for
+  future versions.
 
-..   _`Coding style for PyObjC`: coding-style.html
 
-..   _`Using LibFFI with PyObjC`: libffi.html
 
-..   _`PyObjC Architecture`: architecture.html
+.. _`Project Builder Python Support`: ProjectBuilder-SyntaxHighlighting.html
 
-..   _`Structure of the PyObjC package`: structure.html
+.. _`An introduction to PyObjC`: intro.html
 
-..   _`How to wrap an Objective-C class library`: wrapping.html
+.. _`Userguide for PyObjC`: users.html
 
-..   _`Odd features`: warts.html
+.. _`Python classes and Objective-C code`: classes.html
 
-..   _`Creating your first PyObjC application (tutorial)`: tutorial/tutorial.html
+.. _`Coding style for PyObjC`: coding-style.html
 
-..   _`Notes on supported APIs and classes on MacOS X`: api-notes-macosx.txt
+.. _`Using LibFFI with PyObjC`: libffi.html
 
+.. _`PyObjC Architecture`: architecture.html
+
+.. _`Structure of the PyObjC package`: structure.html
+
+.. _`How to wrap an Objective-C class library`: wrapping.html
+
+.. _`Odd features`: warts.html
+
+.. _`Creating your first PyObjC application (tutorial)`: tutorial/tutorial.html
+
+.. _`Adding Python code to an existing ObjC application`: tutorial_embed/extending_objc_with_python.html
+
+.. _`Notes on supported APIs and classes on MacOS X`: api-notes-macosx.txt

pyobjc/Doc/libffi.html

-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>
-Using LibFFI with PyObjC</title>
-<meta name="Author" content="Ronald Oussoren" />
-</head>
-<body>
-<h2>Using LibFFI with PyObjC</h2>
-<table>
-<tbody valign="top">
-<tr><th >Author:</th>
-<td>Ronald Oussoren</td></tr>
-</tbody>
-</table>
-<p>PyObjC uses libffi to dynamicly call into Objective-C. We use libffi instead of
-NSInvocation because the former makes it possible to call superclass methods,
-and to generate stubs for use in Objective-C method tables on the fly.</p>
-<p>It is currently possible to build a non-ffi build of PyObjC, but that is not
-supported and will be removed as we use features from libffi to further 
-improve the brigde.</p>
-</body>
-</html>

pyobjc/Doc/libffi.txt

-========================
-Using LibFFI with PyObjC
-========================
-
-:author: Ronald Oussoren
-
-PyObjC uses libffi to dynamicly call into Objective-C. We use libffi instead of
-NSInvocation because the former makes it possible to call superclass methods,
-and to generate stubs for use in Objective-C method tables on the fly.
-
-It is currently possible to build a non-ffi build of PyObjC, but that is not
-supported and will be removed as we use features from libffi to further 
-improve the brigde.

pyobjc/Doc/structure.html

 <h2><a name="introduction">Introduction</a></h2>
 <p>This document gives an overview of the PyObjC for developers (of the package).</p>
 <p>One of the sections describes how all of it works, and some of the limitation.</p>
+<p>This document is a little dated, it should be updated.</p>
 <h2><a name="methods">Methods</a></h2>
 <p>Classes are scanned for methods when the python wrapper for a class is created.
 We then create python wrappers for those methods. This way users can use the

pyobjc/Doc/structure.txt

 
 One of the sections describes how all of it works, and some of the limitation.
 
+This document is a little dated, it should be updated.
+
 
 Methods
 -------

pyobjc/Doc/wrapping.html

 <p>The code above only provides wrappers for Objective-C classes, if the library
 also defines global functions and/or constants you'll have to write an 
 extension module to make these available to Python.</p>
-<p>You can use the PyObjC C-API (to be documented) when writing this module.</p>
+<p>You can use the PyObjC C-API (to be documented) when writing this module. With
+some luck you can adapt the scripts in <code><span>Scripts/CodeGenerators</span></code> to generate
+this module for you. These scripts are both very rough and tuned for the Apple
+headers, so YMMV.</p>
+<p>Note that we currently do not install the <code><span>pyobjc-api.h</span></code> header, you'll have
+to copy it from the source-tree until we do.</p>
 <h2><a name="pointer-arguments">Pointer arguments</a></h2>
 <p>Methods with pointer arguments (other then arguments that are equivalent to 
 an 'id') require more work. If the pointer arguments are used to pass a single 
 value to/from a function ('pass-by-reference arguments') you'll just have to 
 provide more specific method signatures. In other cases you'll have to write
 custom wrappers for these methods.</p>
+<p>Check <code><span>Modules/Foundation</span></code> for examples of these custom wrappers.</p>
 <h3><a name="pass-by-reference-arguments">Pass-by-reference arguments</a></h3>
 <p>Pass-by-reference arguments can be 'in' (data passed into the function), 
 'out' (data is returned from the function) or 'inout' (data is passed into 
 '^' characters in the signature of a method. The characters are:</p>
 <ul>
 <li>output parameter: o</li>
-<li>input parameter: i</li>
-<li>input-output parameter: O</li>
+<li>input parameter: n</li>
+<li>input-output parameter: N</li>
 </ul>
 <h3><a name="special-wrappers">special wrappers</a></h3>
 <p>If the method has pointer arguments that are not pass-by-reference arguments,
 <p>For now it is best to check the source code for the wrappers for the Cocoa 
 class library for more information. We'll add documentation for this in the
 future.</p>
-<p>NOTE: It is likely that there will be changes w.r.t. the special wrappers.</p>
 <h3><a name="protocols">protocols</a></h3>
 <p>If the framework defines any (informal) protocols you should add 
 <code><span>objc.informal_protocol</span></code> objects for those protocols to your module. These
 can be defined in a submodule, as long as you arrange for that module to be
 loaded whenever someone imports your package.</p>
+<p>See <code><span>Lib/Foundation/protocols.py</span></code> for examples of protocol definitions.</p>
 </body>
 </html>

pyobjc/Doc/wrapping.txt

 also defines global functions and/or constants you'll have to write an 
 extension module to make these available to Python.
 
-You can use the PyObjC C-API (to be documented) when writing this module.
+You can use the PyObjC C-API (to be documented) when writing this module. With
+some luck you can adapt the scripts in ``Scripts/CodeGenerators`` to generate
+this module for you. These scripts are both very rough and tuned for the Apple
+headers, so YMMV.
+
+Note that we currently do not install the ``pyobjc-api.h`` header, you'll have
+to copy it from the source-tree until we do.
 
 Pointer arguments
 -----------------
 provide more specific method signatures. In other cases you'll have to write
 custom wrappers for these methods.
 
+Check ``Modules/Foundation`` for examples of these custom wrappers.
+
 Pass-by-reference arguments
 ...........................
 
 
 - output parameter: o
 
-- input parameter: i
+- input parameter: n
 
-- input-output parameter: O
+- input-output parameter: N
 
 special wrappers
 ................
 class library for more information. We'll add documentation for this in the
 future.
 
-NOTE: It is likely that there will be changes w.r.t. the special wrappers.
-
 protocols
 .........
 
 ``objc.informal_protocol`` objects for those protocols to your module. These
 can be defined in a submodule, as long as you arrange for that module to be
 loaded whenever someone imports your package.
+
+See ``Lib/Foundation/protocols.py`` for examples of protocol definitions.

pyobjc/Lib/AppKit/__init__.py

 This module does not contain docstrings for the wrapped code, check Apple's
 documentation for details on how to use these functions and classes.
 """
+import Foundation
 import _AppKitSignatures 
 import objc as _objc
 
 
 from _AppKit import *
 
-CLASSLIST=[
-	"NSGrayFrame",
-	"NSPopUpButton",
-	"NSPPDParse",
-	"NSMenuArrowView",
-	"_NSDIBPboardTypeConverter",
-	"NSGlyphHole",
-	"NSImageWriter",
-	"NSDirInfoSerializer",
-	"NSCStringText",
-	"NSPrintInfoAttributeDictionary",
-	"NSMenu",
-	"NSFocusState",
-	"NSHelpAttachment",
-	"NSAccessibilityProxy",
-	"NSImageCell",
-	"NSSurface",
-	"NSInputManager",
-	"_NSFilePromiseTypeConverter",
-	"NSGreySliders",
-	"NSMutableParagraphStyle",
-	"NSFileWrapper",
-	"NSTableHeaderCell",
-	"_NSToolbarItemViewerLabelCellPopUpCellProxy",
-	"NSAccessibilityNotifier",
-	"NSFontManager",
-	"NSServicesPasteboard",
-	"NSCarbonMenuImpl",
-	"NSStorage",
-	"NSDisclosureButtonCell",
-	"NSFileLocator",
-	"NSTableColumn",
-	"NSToolbar",
-	"NSFlippableView",
-	"NSViewTextAttachmentCellHelper",
-	"NSColorPanelColorWell",
-	"NSJPEGImageReader",
-	"NSOutlineView",
-	"NSToolbarPoofAnimator",
-	"NSJPEGImageWriter",
-	"NSViewRectCache",
-	"NSTSMInputContext",
-	"NSNewFolderPanel",
-	"_NSColorPanelToolbarItem",
-	"_NSPICTPboardTypeConverter",
-	"NSDeadKeyInputServer",
-	"NSPageData",
-	"NSRulebookSetObject",
-	"NSTextStorage",
-	"NSAttachmentTextStorage",
-	"NSExceptionHandlingRecursiveLock",
-	"NSScrollView",
-	"_NSToolbarButtonCell",
-	"_NSDragManager",
-	"NSInputContext",
-	"NSKeyBindingManager",
-	"NSEvent",
-	"_NSPDFPboardTypeConverter",
-	"NSPersistentGraphicsContext",
-	"NSMouseTracker",
-	"_NSMovieUndoOperation",
-	"NSSliderCell",
-	"NSAKDeserializer",
-	"NSCarbonWindow",
-	"NSConcreteTextStorage",
-	"NSPSMatrix",
-	"NSIdentityGlyphInfo",
-	"NSFocusStack",
-	"NSControl",
-	"NSRulerView",
-	"NSLocalInputServer",
-	"NSHFSObject",
-	"NSStepper",
-	"NSHFSBrowserCell",
-	"NSGradientPatternColor",
-	"NSDPSContext",
-	"_NSToolbarImageRepView",
-	"NSConcreteGlyphGenerator",
-	"_NSFileNameFormatter",
-	"NSMoveHelper",
-	"NSImageRep",
-	"NSCoreDragManager",
-	"NSSlider",
-	"NSWindowGraphicsContext",
-	"NSViewHierarchyLock",
-	"NSProgressIndicator",
-	"NSFontPanelPreviewSplitView",
-	"NSThemeTearOffFrame",
-	"NSLanguage",
-	"_NSStringPboardTypeConverter",
-	"NSObsoleteBitmap",
-	"_NSTIFFPboardTypeConverter",
-	"NSFormCell",
-	"_NSAsciiPboardTypeConverter",
-	"NSToolbarSeparatorItem",
-	"NSHyphenator",
-	"NSButton",
-	"NSLayoutHole",
-	"NSDefaultSpellServerDelegate",
-	"NSDocumentDragButton",
-	"NSToolTipPanel",
-	"NSComboBoxWindow",
-	"NSRulebook",
-	"_NSContextHelpBorderView",
-	"NSPrinter",
-	"NSSecureTextField",
-	"NSOpenGLPixelFormat",
-	"NSBrowserCell",
-	"NSCachedImageRep",
-	"NSButtonCell",
-	"NSTextAttachment",
-	"NSGIFImageReader",
-	"NSGIFImageWriter",
-	"NSFontPanelPreview",
-	"NSToolbarView",
-	"NSColorPickerUserView",
-	"NSTextField",
-	"NSFrameView",
-	"NSAccessibilityMockUIElement",
-	"_NSCornerView",
-	"NSAKSerializerStream",
-	"NSAttributeDictionary",
-	"NSServiceListener",
-	"NSMenuItemCell",
-	"NSGraphicsContext",
-	"NSQuickDrawView",
-	"NSMenuItem",
-	"NSWindowController",
-	"NSView",
-	"NSBezierPath",
-	"NSFontPanel",
-	"NSColorPickerCrayon",
-	"NSAlert",
-	"NSPICTStream",
-	"NSFileSpecifier",
-	"NSPDFImageRep",
-	"NSSystemInfoPanel",
-	"NSPrintInfo",
-	"NSColorPanelResizeDimple",
-	"NSCatalogColor",
-	"NSTextViewSharedData",
-	"NSCollatorElement",
-	"NSAccessibilityStepperArrowButton",
-	"NSCalibratedRGBColor",
-	"NSCustomImageRep",
-	"_NSSparseArrayEnumeration",
-	"NSSavePanel",
-	"NSColorScaleSliderCell",
-	"_NSToolbarItemViewerLabelCellPopUpCell",
-	"NSBMPImageReader",
-	"NSIncrementalImageReader",
-	"NSRTFWriter",
-	"NSPageLayout",
-	"NSBitmapImageRep",
-	"NSHSBSliders",
-	"NSCollator",
-	"NSColor",
-	"NSAppleMenuItemRepresentedObject",
-	"NSToolbarFlexibleSpaceItem",
-	"NSFont",
-	"_PanelLoader",
-	"NSTabWell",
-	"NSTextView",
-	"NSColorPickerWheelView",
-	"NSWorkspace",
-	"NSThemeFrame",
-	"NSSortedArray",
-	"NSIBObjectData",
-	"NSStringDrawingTextStorage",
-	"_NSMagnifier",
-	"_NSPeriodicEventSource",
-	"_NSColorPboardTypeConverter",
-	"NSDocument",
-	"NSFilePromiseDragSource",
-	"NSColorPanel",
-	"NSColorPickerWheel",
-	"NSPopUpButtonCell",
-	"NSMenuPanel",
-	"_NSToolbarSeparator",
-	"NSServiceMaster",
-	"_NSFlippedImage",
-	"NSOutlineRow",
-	"NSAffineTransform",
-	"NSCompressedSimpleCollatorElement",
-	"NSSimpleNumberFormatter",
-	"NSLeafProxy",
-	"NSTitledFrame",
-	"_NSViewGState",
-	"NSPasteboard",
-	"NSTableRow",
-	"NSMovieViewTextAttachmentCell",
-	"NSWindow",
-	"NSBinaryCollatorElement",
-	"NSAccessibilityScrollerPart",
-	"NSImageViewTextAttachmentCell",
-	"NSComboBox",
-	"_NSAttributes",
-	"NSDeviceRGBColor",
-	"NSMovieView",
-	"NSFontPanelScrollView",
-	"NSDrawerFrame",
-	"NSTracer",
-	"NSTypesetter",
-	"NSInputClientWrapper",
-	"NSKeyBindingAtom",
-	"NSATSTypesetter",
-	"NSComboBoxCell",
-	"NSToolbarSpaceItem",
-	"NSMultipassCollatorElement",
-	"NSCrayon",
-	"NSHFSiDiskObject",
-	"NSPanelController",
-	"NSCMYKSliders",
-	"_NSThemeCloseWidgetCell",
-	"_NSThemeWidget",
-	"NSRTFD",
-	"NSSavePanelFormCell",
-	"NSTableView",
-	"NSCharacterProperty",
-	"NSDirInfo",
-	"NSCustomView",
-	"NSStopTouchingMeBox",
-	"NSToolbarClippedItemsIndicator",
-	"NSColorList",
-	"NSUIHeartBeat",
-	"NSButtonImageSource",
-	"NSDrawerWindow",
-	"NSImage",
-	"NSSecureTextFieldCell",
-	"NSImageReader",
-	"NSCIDGlyphInfo",
-	"NSTabViewItem",
-	"NSPreferencesModule",
-	"NSQTImageImporter",
-	"NSMultipassCollatorState",
-	"NSEPSImageRep",
-	"_NSThemeWidgetCell",
-	"NSRulerMarker",
-	"NSCursor",
-	"NSScreen",
-	"NSNibConnector",
-	"NSCell",
-	"NSGlyphNameGlyphInfo",
-	"NSNoBranchIconBrowserCell",
-	"NSConcreteNotifyingMutableAttributedString",
-	"NSRulebookCharacterSet",
-	"NSIBHelpConnector",
-	"NSCompressedMultipassCollatorElement",
-	"_NSKeyboardFocusClipView",
-	"_NSDrawingThreadData",
-	"_NSFocusStackElement",
-	"NSUndoTextOperation",
-	"NSRulerMarkerPanel",
-	"NSAppleMenuController",
-	"NSProgressPanel",
-	"NSSplitView",
-	"NSMenuTemplate",
-	"__NSEventDiscardInfo",
-	"NSKitPanelController",
-	"NSPSAndPDFGraphicsContext",
-	"NSTabView",
-	"NSSystemStatusBar",
-	"NSQuickDrawPort",
-	"NSUndoSetAttributes",
-	"NSToolbarButton",
-	"_NSPDFDocument",
-	"NSPreferences",
-	"NSDPSServerContext",
-	"NSGlyphInfo",
-	"NSLayoutManager",
-	"NSRemoteInputServer",
-	"NSOpenPanel",
-	"_NSCGFontCharacterSet",
-	"NSStatusBarButtonCell",
-	"NSDeviceWhiteColor",
-	"_NSPromiseContentsTypeConverter",
-	"_NSQDCGSContext",
-	"NSPICTImageRep",
-	"NSAccessibilityWindowGrowBox",
-	"NSPrintOperation",
-	"NSSecureTextStorage",
-	"NSLineHeightFormatter",
-	"NSRunStorage",
-	"NSStatusBarWindow",
-	"NSColorPickerList",
-	"NSPanel",
-	"NSMenuView",
-	"NSICOImageReader",
-	"NSSimpleHorizontalTypesetter",
-	"_NSFilenamePboardTypeConverter",
-	"_NSURLPboardTypeConverter",
-	"NSDirInfoDeserializer",
-	"NSTextTemplate",
-	"NSHFSContainer",
-	"NXTypesPair",
-	"NSOpenGLContext",
-	"NSToolbarItemViewer",
-	"_NSSavePanelForm",
-	"NSATSGlyphGenerator",
-	"NSLazyBrowserCell",
-	"NSTempAttributeDictionary",
-	"NSClassSwapper",
-	"NSSpellChecker",
-	"NSActionCell",
-	"NSBox",
-	"NSUnavailableLanguagePlaceholder",
-	"NSTextViewTemplate",
-	"NSDocInfo",
-	"NSToolTipManager",
-	"NSMatrix",
-	"NSPNGImageReader",
-	"NSPNGImageWriter",
-	"NSTextAttachmentMovieView",
-	"NSAKSerializer",
-	"NSDeviceCMYKColor",
-	"NSColorHolder",
-	"NSParagraphStyle",
-	"NSTiogaGraphicsContext",
-	"NSSplitViewSplitter",
-	"NSViewTextAttachmentCell",
-	"NSClipView",
-	"NSCustomResource",
-	"_NSThemeCloseWidget",
-	"_NSColorPanelToolbar",
-	"NSCustomObject",
-	"NSDocumentSerializer",
-	"NSColorSwatch",
-	"_NSAttributeRun",
-	"NSDocumentController",
-	"_NSToolbarItemPlaceholder",
-	"NSFontPanelMatrix",
-	"NSStepperCell",
-	"NSNibControlConnector",
-	"NSNSPrintInfoAttributeKeyEnumerator",
-	"NSDynamicSystemColor",
-	"NSColorWell",
-	"NSImageView",
-	"NSFileDragSource",
-	"NSQueryText",
-	"NSToolTip",
-	"NSTableHeaderView",
-	"NSCachedWhiteColor",
-	"_NSButtonImage",
-	"NSHFSIndirectObject",
-	"NSColorScaleSlider",
-	"NSScrollingMatrix",
-	"NSStringDrawingContext",
-	"NSText",
-	"NSCarbonWindowFrame",
-	"NSSavePanelBox",
-	"NSCachedRGBColor",
-	"_NSToolbarItemViewerLabelCell",
-	"NSRTFReader",
-	"NSMenuScrollView",
-	"NSBMPImageWriter",
-	"NSColorPickerSliders",
-	"_NSSparseArray",
-	"NSUndoReplaceCharacters",
-	"NSBulletString",
-	"NSToolbarItem",
-	"NSForm",
-	"NSAccessibilityReparentingCellProxy",
-	"_NSToolbarFlexibleSpace",
-	"NSServicesMenuHandler",
-	"NSPatternColor",
-	"NSScroller",
-	"NSConcretePrintOperation",
-	"NSAKDeserializerStream",
-	"NSColorSpaceSliders",
-	"NSTextFieldCell",
-	"NSViewTemplate",
-	"NSAcceptsColorBrowser",
-	"NSRGBSliders",
-	"NSNextStepFrame",
-	"NSThemeDocumentButton",
-	"NSHelpManager",
-	"NSPrintPanel",
-	"NSDragDestination",
-	"_NSPboardTypeConverter",
-	"NSColorPicker",
-	"NSComboTableView",
-	"NSTextAttachmentCell",
-	"NSAttributeDictionaryEnumerator",
-	"NSBrowser",
-	"NSTableViewCellProxy",
-	"NSOpenGLView",
-	"NSTextContainer",
-	"NSColorPanelTextController",
-	"NSMovie",
-	"NSStatusBar",
-	"NSApplication",
-	"NSDocumentDeserializer",
-	"NSPICTParser",
-	"_NSToolbarViewClipView",
-	"NSCarbonWindowContentView",
-	"NSWindowTemplate",
-	"NSCalibratedWhiteColor",
-	"NSCrayonRow",
-	"NSSound",
-	"NSDrawer",
-	"NSLazyBrowserList",
-	"NSAccessibilityReparentingProxy",
-	"NSCGSFont",
-	"NSColorPickerUser",
-	"NSInputServer",
-	"NSUndoTyping",
-	"_NSToolbarClippedItemsIndicatorCell",
-	"NSGraphicCell",
-	"NSNibOutletConnector",
-	"_NSRTFPboardTypeConverter",
-	"NSWorkspaceCenter",
-	"NSTabletEvent",
-	"NSGlyphGenerator",
-	"NSCGSContext",
-	"NSColorPickerCrayonView",
-	"NSPrivateKitClassForFindingBundle",
-	"NSStatusBarButton",
-	"NSHardLinkInfo",
-	"NSStatusItem",
-	"_NSToolbarSpace",
-	"NSTearOffFrame",
-	"NSThemeDocumentButtonCell",
-	"NSSecureTextView",
-	"NSSubTextStorage",
-	"NSToolbarConfigPanel",
-	"NSScriptMenu",
-	"NSResponder",
-	"NSTextTab",
-	"NSComboBoxButtonCell",
-]
-
 
 # We try to import a module containing support code, the code
 # is only ever used from the C side.
 import _AppKitMapping 
 
 # Load the Cocoa bundle, and gather all classes defined there
-import Foundation
-Foundation._objc.loadBundle("AppKit", globals(), bundle_path="/System/Library/Frameworks/AppKit.framework", bundle_classes=CLASSLIST)
-del CLASSLIST
-Foundation._objc.recycle_autorelease_pool()
+_objc.loadBundle("AppKit", globals(), bundle_path="/System/Library/Frameworks/AppKit.framework")
+_objc.recycle_autorelease_pool()
 del Foundation
 
 
 NSClassForName = _objc.lookUpClass
 
 
-def NSEndSheetMethod(meth):
+def endSheetMethod(meth):
     """
     Return a selector that can be used as the delegate callback for
     sheet methods
     """
-    return _objc.selector(meth, signature='v@:@@i')
+    return _objc.selector(meth, signature='v@:@ii')
 
 def NSMakePoint(p1, p2):
     return (float(p1), float(p2))

pyobjc/Lib/Foundation/__init__.py

 
 from _Foundation import *
 
-CLASSLIST=[
-	"NSRecursiveLock",
-	"NSintNumber",
-	"NSRandomSpecifier",
-	"NSFileURLHandle",
-	"NSGetCommand",
-	"NSPlaceholderValue",
-	"NSCFDate",
-	"NSCFData",
-	"NSRelativeSpecifier",
-	"NSCloneCommand",
-	"NSCFDictionary__",
-	"%NSCFSet",
-	"NSAssertionHandler",
-	"NSAppleEventManager",
-	"%NSCFType",
-	"NSMethodSignature",
-	"Protocol",
-	"NSScanner",
-	"NSString",
-	"%NSCFBoolean",
-	"NSCountedSet",
-	"_NSKeyForwardingSetBinding",
-	"NSScriptObjectSpecifier",
-	"NSTimer",
-	"NSConditionLock",
-	"NSNull__",
-	"_NSSelectorSetBinding",
-	"_NSUndoInvocation",
-	"NSCFSet__",
-	"NSWhoseSpecifier",
-	"NSCFDictionary",
-	"NSMutableAttributedString",
-	"NSCFArray__",
-	"NSKeyBinding",
-	"NSMutableSet",
-	"NSDate",
-	"NSData",
-	"NSAEDescriptorTranslator",
-	"NSMutableStringProxyForMutableAttributedString",
-	"NSMachPort__",
-	"NSExpandedBuiltinCharacterSet",
-	"NSLock",
-	"NSMachBootstrapServer",
-	"%NSCFArray",
-	"NSBuiltinCharacterSet",
-	"NSTimeZoneDetail",
-	"NSTimeZone",
-	"NSScriptCommandConstructionContext",
-	"NSScriptSuiteRegistry",
-	"%NSNull",
-	"NSFileAttributes",
-	"NSImmutableRangeCharacterSet",
-	"NSunsignedLongLongNumber",
-	"NSCFCharacterSet",
-	"NSCondition",
-	"NSLanguageContext",
-	"NSThread",
-	"NSlongLongNumber",
-	"NSConcretePipe",
-	"NSNotification",
-	"NSValueDecoder",
-	"NSSubrangeData",
-	"NSCFArray",
-	"NSMachPort",
-	"NSMutableCharacterSet",
-	"%NSMachPort",
-	"NSArchiver",
-	"NSPlaceholderString",
-	"NSPortCoder",
-	"NSHTTPURLHandle",
-	"NSRunLoop",
-	"NSCountCommand",
-	"OC_PythonArray",
-	"NSAutoreleasePool",
-	"NSConcreteTask",
-	"List",
-	"NSSocketPortNameServer",
-	"OC_PythonDictionaryEnumerator",
-	"_NSMutableKnownKeyDictionary",
-	"NSKeyedArchiver",
-	"NSConcreteNotification",
-	"NSURL",
-	"NSPortNameServer",
-	"NSInvocationBuilder",
-	"NSAttributedString",
-	"NSSimpleCString",
-	"NSFileManager",
-	"NSDeserializer",
-	"NSCFType",
-	"NSCFCharacterSet__",
-	"NSProcessInfo",
-	"%NSCFTimeZone",
-	"NSConcreteMutableAttributedString",
-	"NSPlaceholderArray",
-	"NSConcretePortCoder",
-	"NSMKKDKeyEnumerator",
-	"_NSSelectorGetBinding",
-	"NSInvocation",
-	"NSCFType__",
-	"NSLocalTimeZone",
-	"NSSerializer",
-	"%NSCFTimer",
-	"NSConcreteProtocolChecker",
-	"NSCFString",
-	"NSBundle",
-	"NSEnumerator",
-	"NSParser",
-	"NSCFNumber",
-	"NSBigMutableString",
-	"NSunsignedIntNumber",
-	"NSException",
-	"_NSMKKDSubsetMapping",
-	"NSDistributedLock",
-	"%NSCFDictionary",
-	"NSKeySetBinding",
-	"NSConcreteFileHandle",
-	"%NSCFNumber",
-	"NSArray",
-	"NSCheapMutableString",
-	"NSMutableArray",
-	"NSunsignedShortNumber",
-	"NSScriptCommand",
-	"NSSet",
-	"NSPipe",
-	"NSFault",
-	"NSDecimalNumberHandler",
-	"NSPortMessage",
-	"_NSLocalNotificationCenter",
-	"NSCFDate__",
-	"NSConcreteValue",
-	"NSSimpleAttributeDictionaryEnumerator",
-	"NSSimpleAttributeDictionary",
-	"_NSUndoBeginMark",
-	"NSTask",
-	"_NSKVCPIvarSetBinding",
-	"NSDistantObjectRequest",
-	"NSCFTimeZone__",
-	"NSFTPURLHandle",
-	"NSSpellServer",
-	"NSCFData__",
-	"NSUserDefaults",
-	"NSUnarchiver",
-	"NSCFNumber__",
-	"_NSZombie",
-	"NSScriptingAppleEventHandler",
-	"NSImmutableStringCharacterSet",
-	"NSFileHandle",
-	"NSIdEnumerator",
-	"NSUniqueIDSpecifier",
-	"NSNetServiceBrowser",
-	"NSClassDescription",
-	"NSMultiReadUniWriteLock",
-	"NSValue",
-	"NSCFString__",
-	"NSPlaceholderMutableArray",
-	"NSPort",
-	"NSNetService",
-	"NSCFTimer__",
-	"NSQuitCommand",
-	"NSNull",
-	"NSURLHandle",
-	"NSNumber",
-	"NSIndexSpecifier",
-	"NSMutableString",
-	"NSMutableDictionary",
-	"NSMutableData",
-	"NSPlaceholderDictionary",
-	"_NSUndoLightInvocation",
-	"NSMutableRLEArray",
-	"NSPathStore2",
-	"NSPositionalSpecifier",
-	"NSCreateCommand",
-	"NSCFSet",
-	"NSKeyGetBinding",
-	"NSStreamData",
-	"%NSURL",
-	"NSWhoseTest",
-	"NSScriptExecutionContext",
-	"NSPlaceholderMutableDictionary",
-	"NSConcreteMutableData",
-	"NSNumberFormatter",
-	"NSDateFormatter",
-	"NSAppleEventDescriptor",
-	"NSCoercionHandler",
-	"NSLogicalTest",
-	"NSDeleteCommand",
-	"NSDistributedNotificationCenter",
-	"_NSMKKDGetBinding",
-	"NSMiddleSpecifier",
-	"NSDirectoryEnumerator",
-	"NSPropertySpecifier",
-	"NSCoder",
-	"NSCalendarDate",
-	"NSInvertedCharacterSet",
-	"NSCFBoolean__",
-	"NSConcreteDistantObjectRequest",
-	"_NSCDBinderMaps",
-	"NSRangeSpecifier",
-	"_NSKVCPIvarGetBinding",
-	"NSScriptClassDescription",
-	"NSPlaceholderMutableString",
-	"NSRefCountingNumber",
-	"NSCFBoolean",
-	"NSConstantString",
-	"%NSCFDate",
-	"%NSCFData",
-	"NSPropertyListSerialization",
-	"NSProtocolChecker",
-	"NSAllDescendantPathsEnumerator",
-	"_NSUndoEndMark",
-	"Object",
-	"NSDecimalNumberPlaceholder",
-	"NSNullFileHandle",
-	"NSdoubleNumber",
-	"%NSCFCharacterSet",
-	"NSPlaceholderNumber",
-	"NSSetCommand",
-	"_NSParserSyntaxNode",
-	"NSScriptWhoseTest",
-	"NSAbsoluteURL",
-	"_NSMKKDInitializer",
-	"NSProxy",
-	"NSMutableStringProxy",
-	"NSPlaceholderMutableSet",
-	"NSCloseCommand",
-	"NSConcreteAttributedString",
-	"NSshortNumber",
-	"NSDictionaryEntry",
-	"NSKeyedUnarchiver",
-	"NSRLEArray",
-	"NSSocketPort",
-	"_NSUndoObject",
-	"NSURL__",
-	"NSConnection",
-	"_NSKeyForwardingGetBinding",
-	"NSObjectSpecifier",
-	"NSAppleScript",
-	"NSFaultHandler",
-	"NSTerminologyRegistry",
-	"NSDistributedObjectsStatistics",
-	"NSDebugString",
-	"NSMessagePort",
-	"NSHost",
-	"NSNameSpecifier",
-	"NSConcreteScanner",
-	"NSConcreteMutableCharacterSet",
-	"_NSKeyedCoderOldStyleArray",
-	"NSCharacterSet",
-	"_NSClassToBinderMaps",
-	"NSFormatter",
-	"NSSpecifierTest",
-	"%NSCFString",
-	"_NSUndoStack",
-	"NSUndoManager",
-	"NSDecimalNumber",
-	"NSPlaceholderSet",
-	"NSMoveCommand",
-	"OC_PythonObject",
-	"NSNotificationQueue",
-	"NSScriptCommandDescription",
-	"NSCFTimer",
-	"NSExistsCommand",
-	"NSConcreteData",
-	"NSTimeZoneDetailDecoder",
-	"NSScriptCoercionHandler",
-	"NSNotificationCenter",
-	"NSCFTimeZone",
-	"OC_PythonDictionary",
-	"NSObject",
-	"NSDistantObject",
-	"NSfloatNumber",
-	"NSMessagePortNameServer",
-	"NSDictionary",
-]
 
 NSClassFromString = _objc.lookUpClass
 
 def NSStringFromClass(aClass):
     return aClass.__name__
 
-_objc.loadBundle("Foundation", globals(), bundle_path="/System/Library/Frameworks/Foundation.framework", bundle_classes=CLASSLIST)
-
-del CLASSLIST
+_objc.loadBundle("Foundation", globals(), bundle_path="/System/Library/Frameworks/Foundation.framework")
 
 import os
 import sys

pyobjc/Modules/objc/module.m

 static PyObject*
 loadBundle(PyObject* self __attribute__((__unused__)), PyObject* args, PyObject* kwds)
 {
-static  char* keywords[] = { "module_name", "module_globals", "bundle_path", "bundle_identifier", "bundle_classes", NULL };
+static  char* keywords[] = { "module_name", "module_globals", "bundle_path", "bundle_identifier", NULL };
 	id        bundle;
 	id        strval;
 	int err;
 	PyObject* bundle_path = NULL;
 	PyObject* module_name;
 	PyObject* module_globals;
-	PyObject* bundle_classes = NULL;
 	PyObject* class_list;
 	int       len, i;
 	PyObject* module_key = NULL;
-	PyObject* classes_temp = NULL;
 
 	if (!PyArg_ParseTupleAndKeywords(args, kwds, 
-			"SO|SSO:loadBundle",
+			"SO|SS:loadBundle",
 			keywords, &module_name, &module_globals,
-			&bundle_path, &bundle_identifier, &classes_temp)) {
+			&bundle_path, &bundle_identifier)) {
 		return NULL;
 	}
 
 		return NULL;
 	}
 
-	if (classes_temp != NULL) {
-		PyObject* v;
-		PyObject* seq = PySequence_Fast(classes_temp,
-			"bundle_classes must be a list of strings");
-		if (seq == NULL) {
-			return NULL;
-		}
-
-		bundle_classes = PyDict_New();
-		if (bundle_classes == NULL) {
-			Py_DECREF(seq);
-			return NULL;
-		}
-
-		len = PySequence_Fast_GET_SIZE(seq);
-		for (i = 0; i < len; i++) {
-			v = PySequence_Fast_GET_ITEM(seq, i);
-			if (!PyString_Check(v)) {
-				Py_DECREF(seq);
-				Py_DECREF(bundle_classes);
-				PyErr_SetString(PyExc_TypeError,
-				    "bundle_classes must be a list of strings");
-				return NULL;
-			}
-
-			PyDict_SetItem(bundle_classes, v, Py_None);
-		}
-		Py_DECREF(seq);
-	}
-
-
-
 	if (bundle_path) {
 		err = depythonify_c_value("@", bundle_path, &strval);
 		if (err == -1) {
 
 	[bundle load];
 
-
-
 	class_list = PyObjC_GetClassList();
 	if (class_list == NULL) {	
 		return NULL;
 		}
 	}
 
-	len = PyTuple_Size(class_list);
+	len = PyTuple_GET_SIZE(class_list);
 	for (i = 0; i < len; i++) {
 		PyObject* item;
 		PyObject* mod;
 			}
 		}
 
-		if (bundle_classes) {
-			if (!PyDict_GetItemString(bundle_classes, cls->name)) {
-				if ([NSBundle bundleForClass:cls] != bundle) {
-					continue;
-				}
-			}
-		} else if ([NSBundle bundleForClass:cls] != bundle) {
-			continue;
-		}
-
-		/*
 		if ([NSBundle bundleForClass:cls] != bundle) {
 			continue;
 		}
-		*/
 
 		/* cls is located in bundle */
 		if (PyObject_SetAttr(item, module_key, module_name) == -1) {
 			Py_DECREF(module_key);
 			Py_DECREF(class_list);
-			Py_XDECREF(bundle_classes);
 			return NULL;
 		}
 
 		if (PyDict_SetItemString(module_globals, 
 				((PyTypeObject*)item)->tp_name, item) == -1) {
-			Py_XDECREF(bundle_classes);
 			Py_DECREF(module_key);
 			Py_DECREF(class_list);
 			return NULL;
 		}
 	}
-	Py_XDECREF(bundle_classes);
 	Py_XDECREF(module_key);
 	Py_XDECREF(class_list);
 

pyobjc/Modules/objc/objc-class.m

 	py_super_class = v;
 	super_class = PyObjCClass_GetClass(py_super_class);
 	if (super_class) {
-		PyObjCClass_CheckMethodList(py_super_class);
+		PyObjCClass_CheckMethodList(py_super_class, 1);
 	}
 
 	/*
 }
 
 void 
-PyObjCClass_CheckMethodList(PyObject* cls)
+PyObjCClass_CheckMethodList(PyObject* cls, int recursive)
 {
 	PyObjC_class_info* info;
 	int		   magic;
 
+	//printf("chkml_called %s %d\n", ((PyTypeObject*)cls)->tp_name, recursive);
 	info = get_class_info(cls);
 
 	if (info->class == NULL) return;
 			}
 		}
 
+		if (!recursive) break;
 		if (info->class->super_class == NULL) break;
 		cls = PyObjCClass_New(info->class->super_class);
 		info = get_class_info(cls);
 {
 	PyObject* result;
 
-	PyObjCClass_CheckMethodList(self);
+	/* Python will look for a number of "private" attributes during 
+	 * normal operations, such as when building subclasses. Avoid a
+	 * method rescan when that happens.
+	 *
+	 * NOTE: This method should be rewritten, copy the version of type()
+	 *       and modify as needed, that would avoid unnecessary rescans
+	 * 	 of superclasses. The same strategy is used in object_getattro.
+	 */
+	if (PyString_Check(name) && strncmp(PyString_AS_STRING(name), "__", 2) == 0) {
+		result = PyType_Type.tp_getattro(self, name);
+		if (result != NULL) {
+			return result;
+		}
+	}
+
+	PyObjCClass_CheckMethodList(self, 1);
 	
 	result = PyType_Type.tp_getattro(self, name);
 	if (result != NULL) {
 		return NULL;
 	}
 
-	PyObjCClass_CheckMethodList(cls);
+	PyObjCClass_CheckMethodList(cls, 1);
 	
 	info = get_class_info(cls);
 	if (info->sel_to_py == NULL) {

pyobjc/Modules/objc/objc-object.m

 		assert(PyType_Check(base));
 
 		if (PyObjCClass_Check(base)) {
-			PyObjCClass_CheckMethodList(base);
+			PyObjCClass_CheckMethodList(base, 0);
 		}
 
 		dict = ((PyTypeObject *)base)->tp_dict;
 	/* This should be in the tp_alloc for the new class, but 
 	 * adding a tp_alloc to PyObjCClass_Type doesn't seem to help
 	 */
-	PyObjCClass_CheckMethodList((PyObject*)res->ob_type);
+	PyObjCClass_CheckMethodList((PyObject*)res->ob_type, 1);
 	
 	((PyObjCObject*)res)->objc_object = objc_object;
 	((PyObjCObject*)res)->flags = 0;
 	/* This should be in the tp_alloc for the new class, but 
 	 * adding a tp_alloc to PyObjCClass_Type doesn't seem to help
 	 */
-	PyObjCClass_CheckMethodList((PyObject*)res->ob_type);
+	PyObjCClass_CheckMethodList((PyObject*)res->ob_type, 1);
 	
 	((PyObjCObject*)res)->objc_object = objc_object;
 	((PyObjCObject*)res)->flags = 0;

pyobjc/Modules/objc/objc_util.h

 #include <Foundation/NSMapTable.h>
 extern NSMapTableKeyCallBacks ObjC_PointerKeyCallBacks;
 extern NSMapTableValueCallBacks ObjC_PointerValueCallBacks;
-extern NSMapTableKeyCallBacks ObjC_PyObjectKeyCallBacks;
-extern NSMapTableValueCallBacks ObjC_PyObjectValueCallBacks;
+
+
+//extern NSMapTableKeyCallBacks ObjC_PyObjectKeyCallBacks;
+//extern NSMapTableValueCallBacks ObjC_PyObjectValueCallBacks;
 
 
 #endif /* OBJC_UTIL */

pyobjc/Modules/objc/objc_util.m

 	return result;
 }
 
+
 NSMapTableKeyCallBacks ObjC_PointerKeyCallBacks = {
 	NULL,
 	NULL,
 	NULL,
 };
 
+#if 0
 static void pyobj_retain(NSMapTable* table __attribute__((__unused__)), const void* v)
 {
 	Py_XINCREF((PyObject*)v);
 	pyobj_release,
 	NULL,
 };
+
+#endif

pyobjc/Modules/objc/pyobjc.h

 void 	  PyObjCClass_MaybeRescan(PyObject* class);
 int 	  PyObjCClass_IsSubClass(Class child, Class parent);
 int 	  ObjC_RegisterClassProxy(Class cls, PyObject* classProxy);
-void PyObjCClass_CheckMethodList(PyObject* cls);
+void PyObjCClass_CheckMethodList(PyObject* cls, int recursive);
 int PyObjCClass_DictOffset(PyObject* cls);
 PyObject* PyObjCClass_GetDelMethod(PyObject* cls);
 void PyObjCClass_SetDelMethod(PyObject* cls, PyObject* newval);

pyobjc/Modules/objc/selector.m

 }
 
 static PyObject*
-objcsel_descr_get(ObjCNativeSelector* meth, PyObject* obj, PyObject* class)
+objcsel_descr_get(ObjCNativeSelector* meth, PyObject* volatile obj, PyObject* class)
 {
 	ObjCNativeSelector* result;