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

Re: /usr/bin/python in Python 2 and 3



On Friday, April 17, 2015 05:11:45 PM Geoffrey Thomas wrote:
> I've written up the proposal I made a few days ago for a /usr/bin/python
> launcher that keeps the API of being Python 2, but lets scripts opt in to
> running on Python 3:
> 
> https://ldpreload.com/blog/usr-bin-python-23
> 
> I share the desire for /usr/bin/python to maintain its API of being Python
> 2, but I also want to be able to write polyglot Python 2/3 scripts that
> run everyhwere -- including on Debian machines with just Python 3. So this
> is a way of "doing something else with /usr/bin/python" that's
> backwards-compatible for us and all the other distros. It even happens to
> be be kind of backwards-compatible for Arch, and Barry's point about
> aligning the desires of the distros is a very good one.
> 
> Let me know if you think this is a good or bad idea: I'll submit this as a
> PEP as soon as we have rough consensus that this is a good idea. (We can
> bikeshed the details once the idea itself is a draft PEP.)

I like it and I don't.  If /usr/bin/python is ever going to point to a non-
python2 version, then I think the solution is something like this.  OTOH, it 
adds system complexity and presumably slows interpreter startup.

If the implementation were simple enough and well enough tested, then I think 
the complexity concern is not a major issue.  Interpreter startup time is a 
big deal in some applications, so that merits some investigation before anyone 
decides this is "the" solution to the problem.

I wonder if dh_python3 could at some point parse the magic line to assist in 
dependency generation.

Scott K


Reply to: