[Pythonmac-SIG] Living dangerously or not?

Jack Jansen Jack.Jansen@cwi.nl
Thu, 04 Mar 1999 23:03:12 +0100


The appearance manager talk recently has reminded me of something that 
probably not too many Pythoneers are aware of, but there are quite a
few toolbox calls that are exported to Python even when they're not
available on the current machine. The new appearance calls in the
various modules like Menu and Dlg are examples of this: the module has 
AppearanceLib weakly linked, otherwise the module won't load on a
machine that has no appearance support. If, however, on such a machine 
you subsequently try to call, say, SetMenuKeyModifiers the interpreter 
will happily jump to address 0 and crash. Something similar holds for
trying to access quicktime 3 functions on a quicktime 2.5 machine, for 
instance. Or on a machine with no quicktime at all:-)

I _could_ do something about this, by adding code to the bgenned
modules that checks that the function actually is non-zero before
trying to call it, but this'll incur an overhead for each and every
call. And, since noone has yet flamed me this behaviour it has
apparently gone unnoticed until now, I'm a bit reluctant to put work in 
something that hasn't bothered me, and will make everything slower
too....
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@cwi.nl      | ++++ if you agree copy these lines to your sig ++++
http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm