python-dev summary, 2001-02-01 - 2001-02-15
It is with some trepidation that I post: This is a summary of traffic on the python-dev mailing list between Feb 1 and Feb 14 2001. It is intended to inform the wider Python community of ongoing developments. To comment, just post to python-list@python.org or comp.lang.python in the usual way. Give your posting a meaningful subject line, and if it's about a PEP, include the PEP number (e.g. Subject: PEP 201 - Lockstep iteration) All python-dev members are interested in seeing ideas discussed by the community, so don't hesitate to take a stance on a PEP if you have an opinion. This is the first python-dev summary written by Michael Hudson. Previous summaries were written by Andrew Kuchling and can be found at: <http://www.amk.ca/python/dev/> New summaries will probably appear at: <http://starship.python.net/crew/mwh/summaries/> When I get round to it. Posting distribution (with apologies to mbm) Number of articles in summary: 498 80 | ]|[ | ]|[ | ]|[ | ]|[ | ]|[ ]|[ 60 | ]|[ ]|[ | ]|[ ]|[ | ]|[ ]|[ | ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ 40 | ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ 20 | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ | ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ ]|[ 0 +-029-067-039-037-080-048-020-009-040-021-008-030-043-027 Thu 01| Sat 03| Mon 05| Wed 07| Fri 09| Sun 11| Tue 13| Fri 02 Sun 04 Tue 06 Thu 08 Sat 10 Mon 12 Wed 14 A fairly busy fortnight on python-dev, falling just short of five hundred articles. Much of this is making ready for the Python 2.1 release, but people's horizons are beginning to rise above the present. * Python 2.1a2 * Python 2.1a2 was released on Feb. 2. One of the more controversial changes was the disallowing of "from module import *" at anything other than module level; this restriction was weakened after some slightly heated discussion on comp.lang.python. <http://mail.python.org/pipermail/python-dev/2001-February/012815.html> It is possible that non-module-level "from module import *" will produce some kind of warning in Python 2.1 but this code has not yet been written. * Performance * Almost two weeks ago, we were talking about performance. Michael Hudson posted the results of an extended benchmarking session using Marc-Andre Lemburg's pybench suite: <http://mail.python.org/pipermail/python-dev/2001-January/012330.html> to which the conclusion was that python 2.1 will be marginally slower than python 2.0, but it's not worth shouting about. The use of Vladimir Marangoz's obmalloc patch in some of the benchmarks sparked a discussion about whether this patch should be incorporated into Python 2.1. There was support from many for adding it on an opt-in basis, since when nothing has happened... * Imports on case-insensitive file systems * There was quite some discussion about how to handle imports on a case-insensitive file system (eg. on Windows). I didn't follow the details, but Tim Peters is on the case (sorry), so I'm confident it will get sorted out. * Sets & iterators * The Sets discussion rumbled on, moving into areas of syntax. The syntax: for key:value in dict: was proposed. Discussion went round and round for a while and moved on to more general iteration constructs, prompting Ka-Ping Yee to write a PEP entitled "iterators": <http://python.sourceforge.net/peps/pep-0234.html> Please comment! Greg Wilson announced that BOFs for both sets and iterators have been arranged at the python9 conference in March: <http://mail.python.org/pipermail/python-dev/2001-February/012824.html> * Stackless Python in Korea * Christian Tismer gave a presentation on stackless python to over 700 Korean pythonistas: <http://mail.python.org/pipermail/python-dev/2001-February/012601.html> I think almost everyone was amazed and delighted to find that Python has such a fan base. Next stop, the world! * string methodizing the standard library * Eric Raymond clearly got bored one evening and marched through the standard library, converting almost all uses of the string module to use to equivalent string method. * Python's release schedule * Skip Montanaro raised some concerns about Python's accelerated release schedule, and it was pointed out that the default Python for both debian unstable and Redhat 7.1 beta was still 1.5.2. Have *you* upgraded to Python 2.0? If not, why not? * Unit testing (again) * The question of replacing Python's hoary old regrtest-driven test suite with something more modern came up again. Andrew Kuchling enquired whether the issue was to be decided by voting or BDFL fiat: <http://mail.python.org/pipermail/python-dev/2001-February/012830.html> Guido obliged: <http://mail.python.org/pipermail/python-dev/2001-February/012831.html> There was then some discussion of what changes people would like to see made in the standard-Python-unit-testing-framework-elect (PyUnit) before they would be happy with it. Cheers, M.
Michael Hudson wrote:
The use of Vladimir Marangoz's obmalloc patch in some of the benchmarks sparked a discussion about whether this patch should be incorporated into Python 2.1. There was support from many for adding it on an opt-in basis, since when nothing has happened...
... I'm still waiting on BDFL pronouncement on this one. The plan was to check it in for beta1 on an opt-in basis (Vladimir has written the patch this way). -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
Michael Hudson wrote:
The use of Vladimir Marangoz's obmalloc patch in some of the benchmarks sparked a discussion about whether this patch should be incorporated into Python 2.1. There was support from many for adding it on an opt-in basis, since when nothing has happened...
... I'm still waiting on BDFL pronouncement on this one. The plan was to check it in for beta1 on an opt-in basis (Vladimir has written the patch this way).
-- Marc-Andre Lemburg
If it is truly opt-in (supposedly a configure option?), I'm all for it. I recall vaguely though that Jeremy or Tim thought that the patch touches lots of code even when one doesn't opt in. That was a no-no so close before the a2 release. Anybody who actually looked at the code got an opinion on that now? The b1 release is planned for March 1st, or exactly two weeks! --Guido van Rossum (home page: http://www.python.org/~guido/)
[Tim]
If it is truly opt-in (supposedly a configure option?), I'm all for it. I recall vaguely though that Jeremy or Tim thought that the patch touches lots of code even when one doesn't opt in.
Nope, not us. The patch is utterly harmless if not enabled, but dangerous if enabled (because it doesn't implement any critical sections -- see gobs of pre-release email about that).
[Michael Hudson]
... * Imports on case-insensitive file systems *
There was quite some discussion about how to handle imports on a case-insensitive file system (eg. on Windows). I didn't follow the details, but Tim Peters is on the case (sorry), so I'm confident it will get sorted out.
You can be sure the whitespace will be consistent, anyway <wink>. OK, this one sucks. It should really have gotten a PEP, but it cropped up too late in the release cycle and it can't be delayed (see below). Here's the scoop: file systems vary across platforms in whether or not they preserve the case of filenames, and in whether or not the platform C library file-opening functions do or don't insist on case-sensitive matches: case-preserving case-destroying +-------------------+------------------+ case-sensitive | most Unix flavors | brrrrrrrrrr | +-------------------+------------------+ case-insensitive | Windows | some unfortunate | | MacOSX HFS+ | network schemes | | Cygwin | | +-------------------+------------------+ In the upper left box, if you create "fiLe" it's stored as "fiLe", and only open("fiLe") will open it (open("file") will not, nor will the 14 other variations on that theme). In the lower right box, if you create "fiLe", there's no telling what it's stored as-- but most likely as "FILE" --and any of the 16 obvious variations on open("FilE") will open it. The lower left box is a mix: creating "fiLe" stores "fiLe" in the platform directory, but you don't have to match case when opening it; any of the 16 obvious variations on open("FILe") work. NONE OF THAT IS CHANGING! Python will continue to follow platform conventions wrt whether case is preserved when creating a file, and wrt whether open() requires a case-sensitive match. In practice, you should always code as if matches were case-sensitive, else your program won't be portable. But then you should also always open binary files with the "b" flag, and you don't do that either <wink>. What's proposed is to change the semantics of Python "import" statements, and there *only* in the lower left box. Support for MaxOSX HFS+, and for Cygwin, is new in 2.1, so nothing is changing there. What's changing is Windows behavior. Here are the current rules for import on Windows: 1. Despite that the filesystem is case-insensitive, Python insists on a case-sensitive match. But not in the way the upper left box works: if you have two files, FiLe.py and file.py on sys.path, and do import file then if Python finds FiLe.py first, it raises a NameError. It does *not* go on to find file.py; indeed, it's impossible to import any but the first case-insensitive match on sys.path, and then only if case matches exactly in the first case-insensitive match. 2. An ugly exception: if the first case-insensitive match on sys.path is for a file whose name is entirely in upper case (FILE.PY or FILE.PYC or FILE.PYO), then the import silently grabs that, no matter what mixture of case was used in the import statement. This is apparently to cater to miserable old filesystems that really fit in the lower right box. But this exception is unique to Windows, for reasons that may or may not exist <frown>. 3. And another exception: if the envar PYTHONCASEOK exists, Python silently grabs the first case-insensitive match of any kind. So these Windows rules are pretty complicated, and neither match the Unix rules nor provide semantics natural for the native filesystem. That makes them hard to explain to Unix *or* Windows users. Nevertheless, they've worked fine for years, and in isolation there's no compelling reason to change them. However, that was before the MacOSX HFS+ and Cygwin ports arrived. They also have case-preserving case-insensitive filesystems, but the people doing the ports despised the Windows rules. Indeed, a patch to make HFS+ act like Unix for imports got past a reviewer and into the code base, which incidentally made Cygwin also act like Unix (but this met the unbounded approval of the Cygwin folks, so they sure didn't complain -- they had patches of their own pending to do this, but the reviewer for those balked). At a higher level, we want to keep Python consistent, and I in particular want Python to do the same thing on *all* platforms with case-preserving case-insensitive filesystems. Guido too, but he's so sick of this argument don't ask him to confirm that <0.9 wink>. The proposed new semantics for the lower left box: A. If the PYTHONCASEOK envar exists, same as before: silently accept the first case-insensitive match of any kind; raise ImportError if none found. B. Else search sys.path for the first case-sensitive match; raise ImportError if none found. #B is the same rule as is used on Unix, so this will improve cross-platform portability. That's good. #B is also the rule the Mac and Cygwin folks want (and wanted enough to implement themselves, multiple times, which is a powerful argument in PythonLand). It can't cause any existing non-exceptional Windows import to fail, because any existing non-exceptional Windows import finds a case-sensitive match first in the path -- and it still will. An exceptional Windows import currently blows up with a NameError or ImportError, in which latter case it still will, or in which former case will continue searching, and either succeed or blow up with an ImportError. #A is needed to cater to case-destroying filesystems mounted on Windows, and *may* also be used by people so enamored of "natural" Windows behavior that they're willing to set an envar to get it. That's their problem <wink>. I don't intend to implement #A for Unix too, but that's just because I'm not clear on how I *could* do so efficiently (I'm not going to slow imports under Unix just for theoretical purity). The potential damage is here: #2 (matching on ALLCAPS.PY) is proposed to be dropped. Case-destroying filesystems are a vanishing breed, and support for them is ugly. We're already supporting (and will continue to support) PYTHONCASEOK for their benefit, but they don't deserve multiple hacks in 2001. Flame at will. or-flame-at-tim-your-choice-ly y'rs - tim
"TP" == Tim Peters <tim.one@home.com> writes:
TP> [Michael Hudson]
... * Imports on case-insensitive file systems *
There was quite some discussion about how to handle imports on a case-insensitive file system (eg. on Windows). I didn't follow the details, but Tim Peters is on the case (sorry), so I'm confident it will get sorted out.
TP> You can be sure the whitespace will be consistent, anyway TP> <wink>. TP> OK, this one sucks. It should really have gotten a PEP, but it TP> cropped up too late in the release cycle and it can't be delayed TP> (see below). It would be good to capture this in an informational PEP that just describes what the policy is and why. If nothing else, it could be a copy of Tim's message immortalized with a PEP number. Jeremy
participants (6)
-
Guido van Rossum
-
Jeremy Hylton
-
M.-A. Lemburg
-
Michael Hudson
-
Tim Peters
-
Tim Peters