Re: [Python-Dev] File encodings

2004-12-01 Thread M.-A. Lemburg
Gustavo Niemeyer wrote:
[...]
The idiom presented by Bob is the right way to go: wrap
sys.stdout with a StreamWriter.
I don't see that as a good solution, since every Python software
that is internationalizaed will have do figure out this wrapping,
introducing extra overhead unnecessarily.
I don't see any unnecessary overhead and using the wrappers
is really easy, e.g.:
#
# Application uses Latin-1 for I/O, terminal uses UTF-8
#
import codecs, sys
# Make stdout translate Latin-1 output into UTF-8 output
sys.stdout = codecs.EncodedFile(sys.stdout, 'latin-1', 'utf-8')
# Have stdin translate Latin-1 input into UTF-8 input
sys.stdin = codecs.EncodedFile(sys.stdin, 'utf-8', 'latin-1')
We should probably extend the support in StreamRecoder (which
is used by the above EncodedFile helper) to also support Unicode
input to .write() and have a special codec 'unicode' that converts
Unicode to Unicode, so that you can request the EncodedFile object
to return Unicode for .read().
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source  (#1, Dec 01 2004)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Difflib modifications [reposted]

2004-12-01 Thread Christian Robottom Reis

[Reposted to python-dev!]

Hello there,

We've has done some customizations to difflib to make it work well
with pagetests we are running on a project at Canonical, and we are
looking for some guidance as to what's the best way to do them. There
are some tricky bits that have to do with how the class inheritance is
put together, and since we would want to avoid duplicating difflib I
figured we'd ask and see if some grand ideas come up.

A [rough first cut of the] patch is inlined below. Essentially, it does:

- Implements a custom Differ.fancy_compare function that supports
  ellipsis and omits equal content

- Hacks _fancy_replace to skip ellipsis as well.

- Hacks best_ratio and cutoff. I'm a bit fuzzy on why this was
  changed, to be honest, and Celso's travelling today, but IIRC it
  had to do with how difflib grouped changes.

Essentially, what we aim for is:

- Ignoring ellipsisized(!) content
- Omitting content which is equal

I initially thought the best way to do this would be to inherit from
SequenceMatcher and make it not return opcodes for ellipsis. However,
there is no easy way to replace the class short of rewriting major bits
of Differ. I suspect this could be easily changed to use a class
attribute that we could override, but let me know what you think of the
whole thing.

--- /usr/lib/python2.3/difflib.py   2004-11-18 20:05:38.720109040 -0200
+++ difflib.py  2004-11-18 20:24:06.731665680 -0200
@@ -885,6 +885,45 @@
 for line in g:
 yield line
 
+def fancy_compare(self, a, b):
+"""
+>>> import difflib
+>>> engine = difflib.Differ()
+>>> got = ['World is Cruel', 'Dudes are Cool']
+>>> want = ['World ... Cruel', 'Dudes ... Cool']
+>>> list(engine.fancy_compare(want, got))
+[]
+ 
+"""
+cruncher = SequenceMatcher(self.linejunk, a, b)
+for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
+
+if tag == 'replace':
+## replace single line
+if a[alo:ahi][0].rstrip() == '...' and ((ahi - alo) == 1):   
+g = None
+## two lines replaced  
+elif a[alo:ahi][0].rstrip() == '...' and ((ahi - alo) > 1):   
+g = self._fancy_replace(a, (ahi - 1), ahi,
+b, (bhi - 1), bhi)
+## common
+else:
+g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
+elif tag == 'delete':
+g = self._dump('-', a, alo, ahi)
+elif tag == 'insert':
+g = self._dump('+', b, blo, bhi)
+elif tag == 'equal':
+# do not show anything
+g = None
+else:
+raise ValueError, 'unknown tag ' + `tag`
+
+if g:
+for line in g:
+yield line
+
+
 def _dump(self, tag, x, lo, hi):
 """Generate comparison results for a same-tagged range."""
 for i in xrange(lo, hi):
@@ -926,7 +965,13 @@
 
 # don't synch up unless the lines have a similarity score of at
 # least cutoff; best_ratio tracks the best score seen so far
-best_ratio, cutoff = 0.74, 0.75
+#best_ratio, cutoff = 0.74, 0.75
+
+## reduce the cutoff to have enough similarity
+## between ' ... ' and ' blabla '
+## for example 
+best_ratio, cutoff = 0.009, 0.01
+
 cruncher = SequenceMatcher(self.charjunk)
 eqi, eqj = None, None   # 1st indices of equal lines (if any)
 
@@ -981,7 +1026,11 @@
 cruncher.set_seqs(aelt, belt)
 for tag, ai1, ai2, bj1, bj2 in cruncher.get_opcodes():
 la, lb = ai2 - ai1, bj2 - bj1
-if tag == 'replace':
+
+if aelt[ai1:ai2] == '...':
+return
+
+if tag == 'replace':
 atags += '^' * la
 btags += '^' * lb
 elif tag == 'delete':

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Re: Small subprocess patch

2004-12-01 Thread Anthony Baxter
On Wednesday 01 December 2004 09:00, Peter Astrand wrote:
> I'm also wondering if patch 1071755 and 1071764 should go into
> release24-maint:
>
> * 1071755 makes subprocess raise TypeError if Popen is called with a
> bufsize that is not an integer.

Since this isn't changing anything that's user facing (just making the
error handling more explicit) this is suitable for the maint branch.

> * 1071764 adds a new, small utility function.

Please read PEP 6. Maintenance branches are not the place for new
features. For an example why, consult almost any code that requires
Python 2.2 or later. Chances are you'll find, all over the place, code 
like:

try:
True, False
except NameError:
True, False = 1, 0

___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] MS VC compiler versions

2004-12-01 Thread M.-A. Lemburg
Preparing for the distutils patch to allow building extensions
using the .NET SDK compilers, I am compiling a list of version
numbers and MS compiler logo outputs in order to use these to
identify the correct compiler to use for the extensions.
These are the compilers I have found so far:
* MS VC6 (German version; optimizing VC6 compiler):
Optimierender Microsoft (R) 32-Bit C/C++-Compiler, Version 12.00.8804, fuer x86
Copyright (C) Microsoft Corp 1984-1998. Alle Rechte vorbehalten.
* MS .NET SDK 1.1 Compiler (German version; non-optimizing VC7.1 compiler):
Microsoft (R) 32-Bit C/C++-Standardcompiler Version 13.10.3077 für 80x86
Copyright (C) Microsoft Corporation 1984-2002. Alle Rechte vorbehalten.
* MS VC7.1 (aka .NET 2003, US version; optimizing VC7.1 compiler)
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
[It looks as if optimizing vs. non-optimizing is not something that
you can detect by looking at the version number.]
Could you please provide me with more version numbers and logo
printouts ?
Thanks,
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source  (#1, Dec 01 2004)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! 
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MS VC compiler versions

2004-12-01 Thread Hye-Shik Chang
On Wed, 01 Dec 2004 16:10:10 +0100, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
> Could you please provide me with more version numbers and logo
> printouts ?
> 

* MS Windows XP DDK (International version, optimizing VC 7.0):

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9176 for 80x86
Copyright (C) Microsoft Corporation 1984-2001. All rights reserved.

* MS VS6 SP5 (International version, optimizing VC 6.0):

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Hye-Shik
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Trouble installing 2.4

2004-12-01 Thread Thomas Heller
"Andrew Koenig" <[EMAIL PROTECTED]> writes:

> Follow-up:  When I install Python as Administrator, all is well.  In that
> case (but not when installing it as me), it asks whether I want to install
> it for all users or for myself only.  I then install pywin32 and it works.
>
> So it may be that a caveat is in order to people who do not install 2.4 as
> Administrator.

As Martin guessed, a distutils bug, triggered with non-admin Python
installs, and when the add-on package uses the pre-install-script or
post-install-script option.

Please submit a report to SF.

Thanks,

Thomas

___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MS VC compiler versions

2004-12-01 Thread Trent Mick
M.-A. Lemburg wrote:
Preparing for the distutils patch to allow building extensions
using the .NET SDK compilers, I am compiling a list of version
numbers and MS compiler logo outputs in order to use these to
identify the correct compiler to use for the extensions.
These are the compilers I have found so far:
* MS VC6 (German version; optimizing VC6 compiler):
Optimierender Microsoft (R) 32-Bit C/C++-Compiler, Version 12.00.8804, 
fuer x86
Copyright (C) Microsoft Corp 1984-1998. Alle Rechte vorbehalten.
* MS VC6 (US version; optimizing VC6 compiler):
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Trent
--
Trent Mick
[EMAIL PROTECTED]
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Roster Deadline

2004-12-01 Thread Aahz
On Tue, Nov 30, 2004, Tim Hochberg wrote:
>
> Hi Larry,
> 
> FYI: I asked EB about the roster deadline and she says that she doesn't 
> know when it is either. Checking on the Lei Out web page didn't help 
> much either.
> 
> So, you are no wiser now than at the start of this message.

We're even less wise now given that you probably didn't intend this for
python-dev.  ;-)
-- 
Aahz ([EMAIL PROTECTED])   <*> http://www.pythoncraft.com/

WiFi is the SCSI of the 21st Century -- there are fundamental technical
reasons for sacrificing a goat.  (with no apologies to John Woods)
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] adding key argument to min and max

2004-12-01 Thread Steven Bethard
This is my first post to Python dev, so I figured I should introduce myself.

My name's Steven Bethard and I'm a computer science Ph.D. student at
the University of Colorado at Boulder working primarily in the areas
of natural language processing and machine learning.  During my
undergrad at the University of Arizona, I worked as a teaching
assistant teaching Java for 2 1/2 years, though now that I'm at CU
Boulder I pretty much only work in Python.  I started getting active
on the Python list about 6 months ago, and I've been watching
python-dev for the last few months.

On to the real question...

I posted a few notes about this on the python-list and didn't hear
much of a response, so I thought that maybe python-dev is the more
appropriate place (since it involves a change to some of the builtin
functions).

For Python 2.5, I'd like to add a keyword argument 'key' to min and
max like we have now for list.sort and sorted.  I've needed this a
couple of times now, specifically when I have something like a dict of
word counts, and I want the most frequent word, I'd like to do
something like:

>>> d = dict(aaa=3000, bbb=2000, ccc=1000)
>>> max(d, key=d.__getitem__)
'aaa'

I've implemented a patch that provides this functionality, but there
are a few concerns about how it works.  Here's some examples of what
it does now:

>>> d = dict(aaa=3000, bbb=2000, ccc=1000)
>>> max(d)
'ccc'
>>> max(d, key=d.__getitem__)
'aaa'
>>> max(d, d.__getitem__)
{'aaa': 3000, 'bbb': 2000, 'ccc': 1000}

>>> max(('aaa', 3000), ('bbb', 2000), ('ccc', 1000))
('ccc', 1000)
>>> max(('aaa', 3000), ('bbb', 2000), ('ccc', 1000), key=operator.itemgetter(1))
('aaa', 3000)
>>> max(('aaa', 3000), ('bbb', 2000), ('ccc', 1000), operator.itemgetter(1))
('ccc', 1000)

Note the difference between the 2nd and 3rd use of max in each
example.  For backwards compatibility reasons, the 'key' argument
cannot be specified as a positional argument or it will look like max
is being used in the max(a, b, c, ...) form.  This means that a 'key'
argument can *only* be specified as a keyword parameter, thus giving
us the asymmetry we see in these examples.

My real question then is, is this asymmetry a problem?  Is it okay to
have a parameter that is *only* accessable as a keyword parameter?

Thanks,

Steve
-- 
You can wordify anything if you just verb it.
--- Bucky Katt, Get Fuzzy
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] TRUNK UNFROZEN; release24-maint branch has been cut

2004-12-01 Thread Brett C.
Anthony Baxter wrote:
I've cut the release24-maint branch, and updated the Include/patchlevel.h
on trunk and branch (trunk is now 2.5a0, branch is 2.4+)
The trunk and the branch are now both unfrozen and suitable for checkins.
The feature freeze on the trunk is lifted. Remember - if you're checking 
bugfixes into the trunk, either backport them to the branch, or else mark 
the commit message with 'bugfix candidate' or 'backport candidate' or the
like.

Next up will be a 2.3.5 release. I'm going to be travelling for a large chunk
of December (at very short notice) so it's likely that this will happen at the
start of January.
OK, I will send out an email to python-list and python-announce mentioning this 
to the community and that if they have fixes they need to go into 2.3.5 they 
need to get it in ASAP so there is enough time to consider them (with no 
guarantee they will get in) at the end of the week if no one objects.

-Brett
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] adding key argument to min and max

2004-12-01 Thread Phillip J. Eby
At 02:03 PM 12/1/04 -0700, Steven Bethard wrote:
Is it okay to
have a parameter that is *only* accessable as a keyword parameter?
Yes.
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


RE: [Python-Dev] adding key argument to min and max

2004-12-01 Thread Raymond Hettinger
[Steven Bethard]
> For Python 2.5, I'd like to add a keyword argument 'key' to min and
> max like we have now for list.sort and sorted. 
 . . .
> This means that a 'key'
> argument can *only* be specified as a keyword parameter, thus giving
> us the asymmetry we see in these examples.

FWIW, in Py2.5 I plan on adding a key= argument to heapq.nsmallest() and
heapq.nlargest().  There is no "assymmetry" issue with those functions,
so it can be implemented cleanly.  And, since min/max are essentially
the same nsmallest/nlargest with n==1, your use case is covered and
there is no need to mess with the min/max builtins.



> I've needed this a couple of times now, specifically when 
> I have something like a dict of word counts, and I want the most
frequent word

For Py2.4, you can cover your use cases readily adding the recipe for
mostcommon() to a module of favorite utilities:

   http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347615

Alternatively, the recipe for a bag class is a more flexible and still
reasonably efficient:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174



Raymond Hettinger

___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] adding key argument to min and max

2004-12-01 Thread Steven Bethard
Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [Steven Bethard]
> > For Python 2.5, I'd like to add a keyword argument 'key' to min and
> > max like we have now for list.sort and sorted. 
>  . . .
> > This means that a 'key'
> > argument can *only* be specified as a keyword parameter, thus giving
> > us the asymmetry we see in these examples.
> 
> FWIW, in Py2.5 I plan on adding a key= argument to heapq.nsmallest() and
> heapq.nlargest().  There is no "assymmetry" issue with those functions,
> so it can be implemented cleanly.  And, since min/max are essentially
> the same nsmallest/nlargest with n==1, your use case is covered and
> there is no need to mess with the min/max builtins.

I don't want to put words into your mouth, so is this a vote against a
key= argument for min and max?

If nsmallest/nlargest get key= arguments, this would definitely cover
the same cases.  If a key= argument gets vetoed for min and max, I'd
at least like to add a bit of documentation pointing users of min/max
to nsmallest/nlargest if they want a key= argument...

Steve
-- 
You can wordify anything if you just verb it.
--- Bucky Katt, Get Fuzzy
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


RE: [Python-Dev] adding key argument to min and max

2004-12-01 Thread Raymond Hettinger
> I don't want to put words into your mouth, so is this a vote against a
> key= argument for min and max?

Right.  I don't think there is any need.

 
> If nsmallest/nlargest get key= arguments, this would definitely cover
> the same cases. 

Right.


> If a key= argument gets vetoed for min and max, I'd
> at least like to add a bit of documentation pointing users of min/max
> to nsmallest/nlargest if they want a key= argument...

Sounds reasonable.



Raymond


P.S.  In case you're interested, here is the patch:


Index: heapq.py
===
RCS file: /cvsroot/python/python/dist/src/Lib/heapq.py,v
retrieving revision 1.27
diff -u -r1.27 heapq.py
--- heapq.py29 Nov 2004 05:54:47 -  1.27
+++ heapq.py2 Dec 2004 01:32:44 -
@@ -307,6 +307,31 @@
 except ImportError:
 pass
 
+# Extend the implementations of nsmallest and nlargest to use a key=
argument
+_nsmallest = nsmallest
+def nsmallest(n, iterable, key=None):
+"""Find the n smallest elements in a dataset.
+
+Equivalent to:  sorted(iterable, key=key)[:n]
+"""
+if key is None:
+return _nsmallest(n, iterable)
+it = ((key(r), i, r) for i, r in enumerate(iterable))   # decorate
+result = _nsmallest(n, it)
+return [r for k, i, r in result]#
undecorate
+
+_nlargest = nlargest
+def nlargest(n, iterable, key=None):
+"""Find the n largest elements in a dataset.
+
+Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
+"""
+if key is None:
+return _nlargest(n, iterable)
+it = ((key(r), i, r) for i, r in enumerate(iterable))   # decorate
+result = _nlargest(n, it)
+return [r for k, i, r in result]#
undecorate
+
 if __name__ == "__main__":
 # Simple sanity test
 heap = []
Index: test/test_heapq.py
===
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_heapq.py,v
retrieving revision 1.16
diff -u -r1.16 test_heapq.py
--- test/test_heapq.py  29 Nov 2004 05:54:48 -  1.16
+++ test/test_heapq.py  2 Dec 2004 01:32:44 -
@@ -105,13 +105,19 @@
 
 def test_nsmallest(self):
 data = [random.randrange(2000) for i in range(1000)]
+f = lambda x:  x * 547 % 2000
 for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
 self.assertEqual(nsmallest(n, data), sorted(data)[:n])
+self.assertEqual(nsmallest(n, data, key=f),
+ sorted(data, key=f)[:n])
 
 def test_largest(self):
 data = [random.randrange(2000) for i in range(1000)]
+f = lambda x:  x * 547 % 2000
 for n in (0, 1, 2, 10, 100, 400, 999, 1000, 1100):
 self.assertEqual(nlargest(n, data), sorted(data,
reverse=True)[:n])
+self.assertEqual(nlargest(n, data, key=f),
+ sorted(data, key=f, reverse=True)[:n])
 
 
 
#===
===

___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] adding key argument to min and max

2004-12-01 Thread Guido van Rossum
> > I don't want to put words into your mouth, so is this a vote against a
> > key= argument for min and max?
> 
> Right.  I don't think there is any need.

Hm, min and max are probably needed 2-3 orders of magnitude more
frequently than nsmallest/nlargest. So I think it's reasonable to add
the key= argument to min and max as well. (We didn't leave it out of
sorted() because you can already do it with list.sort().)

> def test_largest(self):

shouldn't that be test_nlargest?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


RE: [Python-Dev] adding key argument to min and max

2004-12-01 Thread Raymond Hettinger


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-dev-
> [EMAIL PROTECTED] On Behalf Of Steven Bethard
> Sent: Wednesday, December 01, 2004 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: [Python-Dev] adding key argument to min and max
> 
> This is my first post to Python dev, so I figured I should introduce
> myself.
> 
> My name's Steven Bethard and I'm a computer science Ph.D. student at
> the University of Colorado at Boulder working primarily in the areas
> of natural language processing and machine learning.  During my
> undergrad at the University of Arizona, I worked as a teaching
> assistant teaching Java for 2 1/2 years, though now that I'm at CU
> Boulder I pretty much only work in Python.  I started getting active
> on the Python list about 6 months ago, and I've been watching
> python-dev for the last few months.
> 
> For Python 2.5, I'd like to add a keyword argument 'key' to min and
> max like we have now for list.sort and sorted.
 . . .
> I've implemented a patch that provides this functionality, but there
> are a few concerns about how it works.

Guido says yes.  So, load the patch to SF and assign to me for review,
testing, and documentation.


Raymond

___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Weekly Python Patch/Bug Summary

2004-12-01 Thread Kurt B. Kaiser
Patch / Bug Summary
___

Patches :  258 open ( +4) /  2701 closed ( +1) /  2959 total ( +5)
Bugs:  812 open (+28) /  4642 closed (+13) /  5454 total (+41)
RFE :  160 open ( +4) /   136 closed ( +1) /   296 total ( +5)

New / Reopened Patches
__

#1074261 gzip dies on gz files with many appended headers  (2004-11-27)
   http://python.org/sf/1074381  opened by  Mark Eichin

Flush stdout/stderr if closed (fix for bug 1074011)  (2004-11-29)
   http://python.org/sf/1075147  opened by  Ben Hutchings

gcc compiler on Windows  (2004-11-30)
   http://python.org/sf/1075887  opened by  Michiel de Hoon

AUTH PLAIN in smtplib  (2004-11-30)
   http://python.org/sf/1075928  opened by  James Lan

readline does not need termcap  (2004-12-01)
   http://python.org/sf/1076826  opened by  Michal Čihař

Patches Closed
__

bug#1021756: more informative error message  (2004-11-23)
   http://python.org/sf/1071739  closed by  effbot

New / Reopened Bugs
___

Bugs in _csv module - lineterminator  (2004-11-24)
   http://python.org/sf/1072404  opened by  Chris Withers

mkarg undocumented  (2004-11-24)
   http://python.org/sf/1072410  opened by  Gunter Ohrner

email as_string() omits trailing newline  (2004-11-24)
CLOSED http://python.org/sf/1072623  opened by  Tessa Lau

dyld: ./python.exe multiple definitions of symbol _BC  (2004-11-24)
   http://python.org/sf/1072642  opened by  Marius

thisid not intialized in pindent.py script  (2004-11-24)
   http://python.org/sf/1072853  opened by  Niraj Bajpai

^Z doesn't exit interpreter - 2.4c1 & Win2K  (2004-11-26)
   http://python.org/sf/1073736  opened by  Kent Johnson

subprocess.py doc bug in 2.4c1  (2004-11-26)
CLOSED http://python.org/sf/1073790  opened by  Dan Christensen

2 XML parsing errors  (2004-11-26)
CLOSED http://python.org/sf/1073864  opened by  Peer Janssen

write failure ignored in Py_Finalize()  (2004-11-27)
   http://python.org/sf/1074011  opened by  Matthias Klose

current directory in sys.path handles symlinks badly  (2004-11-26)
   http://python.org/sf/1074015  opened by  Eric M. Hopper

xml.dom.minidom produces errors with certain unicode chars  (2004-11-27)
   http://python.org/sf/1074200  opened by  Peer Janssen

gzip dies on gz files with many appended headers  (2004-11-27)
   http://python.org/sf/1074261  opened by  Mark Eichin

input from numeric pad always dropped when numlock off  (2004-11-27)
   http://python.org/sf/1074333  opened by  Rick Graves

FeedParser problem on end boundaries w/o newline  (2004-11-24)
   http://python.org/sf/1072623  reopened by  tlau

Irregular behavior of datetime.__str__()  (2004-11-27)
   http://python.org/sf/1074462  opened by  Wai Yip Tung

Errors and omissions in logging module documentation  (2004-11-28)
   http://python.org/sf/1074693  opened by  Joachim Boomberschloss

Windows 2.4c1 installer default location issues  (2004-11-28)
   http://python.org/sf/1074873  opened by  dmerrill

exceeding obscure weakproxy bug  (2004-11-29)
   http://python.org/sf/1075356  opened by  Michael Hudson

urllib2.HTTPBasicAuthHandler problem with [HOST]:[PORT]  (2004-11-29)
   http://python.org/sf/1075427  opened by  O-Zone

PyGILState_Ensure() deadlocks (ver 2.4c1)  (2004-11-29)
   http://python.org/sf/1075703  opened by  Andi Vajda

Build Bug on Solaris.  (2004-11-30)
CLOSED http://python.org/sf/1075934  opened by  Jeremy Whiting

Memory fault pyexpat.so on SGI  (2004-11-30)
   http://python.org/sf/1075984  opened by  Maik Hertha

Memory fault pyexpat.so on SGI  (2004-11-30)
   http://python.org/sf/1075990  opened by  Maik Hertha

HTMLParser can't handle page with javascript  (2004-11-30)
   http://python.org/sf/1076070  opened by  Jeremy Hylton

distutils.core.setup() with unicode arguments broken  (2004-11-30)
   http://python.org/sf/1076233  opened by  Walter Dörwald

Whats New for 2.4 "SafeTemplate" patch.  (2004-11-30)
CLOSED http://python.org/sf/1076365  opened by  Sean Reifschneider

test_shutil fails on x86-64 // Suse 9.1  (2004-11-30)
   http://python.org/sf/1076467  opened by  Ross G Baker Jr

Another message that croaks email.FeedParser  (2004-11-30)
   http://python.org/sf/1076485  opened by  Skip Montanaro

Sate/Save typo in Mac/scripts/BuildApplication.py  (2004-11-30)
   http://python.org/sf/1076490  opened by  Neil Mayhew

BuildApplication includes many unneeded modules  (2004-11-30)
   http://python.org/sf/1076492  opened by  Neil Mayhew

python24.msi  install error  (2004-12-01)
   http://python.org/sf/1076500  opened by  guan zi jing

shutil.move clobbers read-only files.  (2004-12-01)
   http://python.org/sf/1076515  opened by  Jeremy Fincher

test test_codecs failed  (2004-12-01)
   http://python.org/sf/1076790  opened by  Michal Čihař

test test_re produced unexpected output  (2004-12-01)
   http://python.org/sf