[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposal: Reorganizing Python for Python2 (and fixes for the previous proposal)



On Mon, 15 Jan 2001, Peter Eckersley wrote:
> On Sun, Jan 14, 2001 at 02:10:25PM -0800, Joey Hess wrote:
> > You mean all python programs will work with 2.0 until 2.1 is out and
> > programs start using its features. At that point every problem I predicted
> > is going to bite you.
> > 
> 
> Exactly.  Unfortunately, I don't think there *is* an easy way to make this
> problem disappear completely.  Really, all python scripts should have some
> way of declaring what they require, such that /usr/bin/python could examine
> them and choose an appropriate interpreter.  I have a sneaking suspicion
> that such an animal is "beyond the scope of this discussion" :).

"declaring what they require", do you mean...
	#!/usr/bin/env python-1.5.2
	#!/usr/bin/env python-2.0
	#!/usr/bin/env python-2.1

You could examine .pys when building a package, if one contains no 2.1
or 2.0-isms, then it "uses" python1.5.2.  [I'm thinking of something
that works along the lines of Python's .../Tools/scripts/fixps.py
(regexes and logic).]

/usr/bin/python-{1.5.2,2.0,2.1} are a single program (sh-script, C) that
decides if a compatible interpreter is installed; err-ing out if, for
example, a prog needs 2.0 and only 1.5.2 is available, passing the prog
onto the appropriate interpreter when one is installed. 

A v2.1 package could concievably end up containing programs "flagged" 
for use with v2.0 and v1.5.2... at the cost of a small run-time startup
delay, and a potentially large built-time penalty (depending on how
straight forward it is to figure out the interpreter requirements, and
how fancy it needs/wants to be).  It would all be optional since the
actual binaries and "python" could still be in /usr/bin/.

So... 
You would have the prog itself saying what it needs, the developer
controlling what gets output after "#!/usr/bin/env " (an override for
special cases), and the user|sysadmin wanting to set a default
interpreter, or even undo the "python-*" bs and call a specific
interpreter -- something would need to be in /etc/python. 

Just a thought.


later,

	Bruce



Reply to: