[Python-3000] [Python-ideas] Namespaces are one honking great idea -- let's do more of those!
mwm at mired.org
Sun Feb 3 19:27:51 CET 2008
On Sat, 2 Feb 2008 23:47:50 -0800 "Gregory P. Smith" <greg at krypto.org> wrote:
> +1 on devising a way (to appear starting in 2.6 and 3.0) of marking the
> minimum language version required by a file near the top so that the parser
> can bail with a useful error message instead of one confusing to the lay
> person. similar to a from future import type of thing perhaps?
-1 on any such programmer-maintained marking. The key phrase is
"programmer-maintained." I think the confusion caused by this being
*wrong*, while less common than simply trying to use the wrong
version, will be much more painful because the user will start with
the assumption that they have a good enough version.
If the goal is to lower user confusion, how about having the 2.X line
issue better warnings if it sees 3.0 features? Just checking syntax
errors against that list and tweaking the warning?
> or should
> python parse a #! line and magically notice a required major version number
> in the python binary name (evil but it would work and magically annotate a
> bunch of existing code as 2 vs 3)?
-2 on using the shebang line for this. The 2.X version-specific
binaries are python2.X, so to use that, you'd have to make the shebang
line invoke python2.X. Right now, if you upgrade an installation from
2.X to 2.X+1, you can expect most of the scripts to work assuming you
take do care to install the same module set. Requiring explicit minor
versions breaks that.
> also yes python 3 should build and install as 'python3' as the short form of
> its name though realistically anyone sane will write their code with #!
> lines specifying the actual version in the executable name and have shell
> aliases setup if they want an even shorter name.
+1, so long as we keep the python alias as well (maybe with the
altinstall target only creating python3 if it doesn't exist). This
will help with the transition from 2 to 3, and then later from 3 to 4,
as we can use python3 vs. python4 in scripts where we now can't use
python2, because it isn't setup by default.
Mike Meyer <mwm at mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
More information about the Python-3000