Re: [Pyobjc-dev] Separating functionality into modules
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-11-18 21:55:21
|
On Monday, Nov 18, 2002, at 16:19 Europe/Amsterdam, bb...@ma... wrote: > On Sunday, November 17, 2002, at 08:41 AM, Ronald Oussoren wrote: >> ... >> It's missing documentation time again :-) :-). The glue code is where >> it is because you currently cannot avoid linking the PyObjC module >> with at least Foundation. This means that >> 'objc.lookup_class("NSSomeFoundationClass")' will always work and >> therefore the glue must be loaded in objc.__init__. >> >> I agree that users should avoid depending on this feature, if we at >> some point in time find a way to remove all dependencies on >> Foundation you will have to import Foundation to get access to those >> classes. > > > You really *should* have to import the Foundation to work with the > Foundation classes. I agree. You can only access Foundation (or AppKit) classes through the objc module if you use objc.lookup_class (soon to be objc.lookUpClass), or objc.class_list (soon to be objc.getClassList). These are low-level interfaces that are not very inviting to users, it is much more convenient to just import Foundation or AppKit. We should take care that we don't accidently export Cocoa classes/functions through the objc module in the future. Ronald |