[Pythonmac-SIG] Framework considered harmful
bill fancher
bfancher@mac.com
Fri, 17 Aug 2001 14:24:47 -0700
On Thursday, August 16, 2001, at 05:50 AM, Jack Jansen wrote:
> People using commandline Python on OSX and interested in the ObjC
> stuff or whatever should check out the latest CVS changs form the
> repository: Python can now be built as a framework.
I discussed this privately with Tony Lownds a while ago, and expressed the
opinion that building as a framework is a bad idea. I should have gone
public earlier.
I believe Python on Mac OS X should look as much like Python on any other
platform as possible. Leave the "special" stuff for Windows and other
non-POSIX systems.
This would be in keeping with guidelines from Apple, which recommend
compiling legacy code as is. Neither TCL nor PERL is a framework. There's
a reason for this.
A non-standard configuration is just asking for trouble with third party
code and should be avoided if at all possible.
For example, I have code that includes Python headers. Using the framework,
I need to change all my code from e.g.
#include <Python.h>
to
#include <Python/Python.h>
And then I need to add /Library/Frameworks as a framework search path.
Alternatively, I can ignore the framework and change things to use the
include path
/Library/Frameworks/Python.framework/Headers
The point being: the "framework support" breaks my code, and it will break
other people's code as well, requiring a Mac-specific song and dance to
get it to work.
Now, I suppose I could just build Python as usual (assuming that still
works) but I then have to make sure that people who use my code have a
standard Python build, instead of a framework build. Having two different
installation possibilities is again a bad idea.
One "solution" would be to have everything in the "usual" place, but to
create symlinks to the various pieces in the framework. Unfortunately,
this defeats one of the major benefits of frameworks (that everything
related to the framework is in the same folder).
OTOH, I think compiling the library as a .dylib is a very, very GOOD idea,
and would much like to see this work "out of the box." I did considerable
work with Tony towards this end.
In closing, one question: What are the benefits that we're supposed to see
from a Python framework?
--
bill
p.s. The "Headers" link in /Library/Frameworks/Python.framework is bad.