Re: [Python-Dev] how bugfixes are handled?

2006-02-17 Thread Martin v. Löwis
Arkadiusz Miskiewicz wrote: I wasn't, thanks for information. Still few questions... one of developers/commiters reviews patch and commit it? Few developers has to review single patch? As Neal says, a single committer can review and commit. However, non-committers can also review; this is

Re: [Python-Dev] bytes type discussion

2006-02-17 Thread Stephen J. Turnbull
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido I think that the implementation of encoding-guessing or Guido auto-encoding-upgrade techniques should be left out of the Guido standard library design for now. As far as I can see, little new design is needed. There's no

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread Martin v. Löwis
Josiah Carlson wrote: I would agree that zip is questionable, but 'uu', 'rot13', perhaps 'hex', and likely a few others that the two of you may be arguing against should stay as encodings, because strictly speaking, they are defined as encodings of data. They may not be encodings of _unicode_

Re: [Python-Dev] Does eval() leak?

2006-02-17 Thread Martin v. Löwis
John Marshall wrote: Should I expect the virtual memory allocation to go up if I do the following? python-dev is a list for discussing development of Python, not the development with Python. Please post this question to [EMAIL PROTECTED] For python-dev, a message explaining where the memory

Re: [Python-Dev] Test failures in test_timeout

2006-02-17 Thread Dmitry Vasiliev
Steve Holden wrote: Thomas Wouters wrote: I'm thinking that it could probably try to connect to a less reliable website, but that's just moving the problem around (and possibly harassing an unsuspecting website, particularly around release-time.) Perhaps the test should try to connect to a

Re: [Python-Dev] bdist_* to stdlib?

2006-02-17 Thread Stephen J. Turnbull
Bob == Bob Ippolito [EMAIL PROTECTED] writes: Bob Huh? What does that have to do with anything? I've never Bob seen a system where /usr/include, /usr/lib, /usr/bin, Bob etc. are not all on the same mount. It's not really any Bob different with OS X either. /usr/share often is

Re: [Python-Dev] http://www.python.org/dev/doc/devel still available

2006-02-17 Thread Bob Ippolito
On Feb 16, 2006, at 11:35 AM, Benji York wrote: Alexander Schremmer wrote: In fact, PHP does it like php.net/functionname which is even shorter, i.e. they fallback to the documentation if that path does not exist otherwise. Like many things PHP, that seems a bit too magical for my

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Georg Brandl
Guido van Rossum wrote: d = DefaultDict([]) can be written as simply d[key].append(value) Feedback? Probably a good idea, has been proposed multiple times on clpy. One good thing would be to be able to specify either a default value or a factory function. While at it, other

[Python-Dev] Does eval() leak?

2006-02-17 Thread John Marshall
Hi, Should I expect the virtual memory allocation to go up if I do the following? - raw = open(data).read() while True: d = eval(raw) - I would have expected the memory allocated to the object referenced by d to be deallocated, garbage collected, and reallocated for the new

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Walter Dörwald
Guido van Rossum wrote: A bunch of Googlers were discussing the best way of doing the following (a common idiom when maintaining a dict of lists of values relating to a key, sometimes called a multimap): if key not in d: d[key] = [] d[key].append(value) An alternative way to spell

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread Jason Orendorff
On 2/15/06, Guido van Rossum [EMAIL PROTECTED] wrote: Actually users trying to figure out Unicode would probably be better served if bytes.encode() and text.decode() did not exist.[...]It would be better if the signature of text.encode() always returned a bytes object. But why deny the bytes

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread Bob Ippolito
On Feb 16, 2006, at 9:20 PM, Josiah Carlson wrote: Greg Ewing [EMAIL PROTECTED] wrote: Josiah Carlson wrote: They may not be encodings of _unicode_ data, But if they're not encodings of unicode data, what business do they have being available through someunicodestring.encode(...)? I

Re: [Python-Dev] http://www.python.org/dev/doc/devel still available

2006-02-17 Thread Georg Brandl
Bob Ippolito wrote: On Feb 16, 2006, at 11:35 AM, Benji York wrote: Alexander Schremmer wrote: In fact, PHP does it like php.net/functionname which is even shorter, i.e. they fallback to the documentation if that path does not exist otherwise. Like many things PHP, that seems a bit

Re: [Python-Dev] bytes.from_hex()

2006-02-17 Thread Stephen J. Turnbull
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido I'd say there are two symmetric API flavors possible (t Guido and b are text and bytes objects, respectively, where text Guido is a string type, either str or unicode; enc is an encoding Guido name): Guido -

Re: [Python-Dev] Please comment on PEP 357 -- adding nb_index slot to PyNumberMethods

2006-02-17 Thread Georg Brandl
Bernhard Herzog wrote: Travis E. Oliphant [EMAIL PROTECTED] writes: 2) The __index__ special method will have the signature def __index__(self): return obj Where obj must be either an int or a long or another object that has the __index__

Re: [Python-Dev] bdist_* to stdlib?

2006-02-17 Thread Jan Claeys
Op wo, 15-02-2006 te 11:23 -0800, schreef Bob Ippolito: On Feb 15, 2006, at 4:49 AM, Jan Claeys wrote: Op wo, 15-02-2006 te 14:00 +1300, schreef Greg Ewing: I'm disappointed that the various Linux distributions still don't seem to have caught onto the very simple idea of *not*

Re: [Python-Dev] PEP 338 issue finalisation (was Re: 2.5 PEP)

2006-02-17 Thread Guido van Rossum
On 2/16/06, Paul Moore [EMAIL PROTECTED] wrote: On 2/16/06, Guido van Rossum [EMAIL PROTECTED] wrote: On 2/16/06, Nick Coghlan [EMAIL PROTECTED] wrote: The PEP itself requests that a string be returned from get_data(), but doesn't require that the file be opened in text mode. Perhaps

Re: [Python-Dev] Please comment on PEP 357 -- adding nb_index slot to PyNumberMethods

2006-02-17 Thread Nick Coghlan
Georg Brandl wrote: Bernhard Herzog wrote: Travis E. Oliphant [EMAIL PROTECTED] writes: 2) The __index__ special method will have the signature def __index__(self): return obj Where obj must be either an int or a long or another object that has

[Python-Dev] str.translate vs unicode.translate (was: Re: str object going in Py3K)

2006-02-17 Thread Bengt Richter
If str becomes unicode for PY 3000, and we then have bytes as out coding-agnostic byte data, then I think bytes should have the str translation method, with a tweak that I would hope could also be done to str now. BTW, str.translate will presumably become unicode.translate, so perhaps

Re: [Python-Dev] bytes type discussion

2006-02-17 Thread Steve Holden
Fredrik Lundh wrote: Barry Warsaw wrote: We know at least there will never be a 2.10, so I think we still have time. because there's no way to count to 10 if you only have one digit? we used to think that back when the gas price was just below 10 SEK/L, but they found a way... IIRC

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Bengt Richter
On Thu, 16 Feb 2006 13:11:49 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: A bunch of Googlers were discussing the best way of doing the following (a common idiom when maintaining a dict of lists of values relating to a key, sometimes called a multimap): if key not in d: d[key] = []

Re: [Python-Dev] [Python-checkins] r42396 - peps/trunk/pep-0011.txt

2006-02-17 Thread Neal Norwitz
[Moving to python-dev] I don't have a strong opinion. Any one else have an opinion about removing --with-wctype-functions from configure? n -- On 2/16/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: neal.norwitz wrote: Author: neal.norwitz Date: Thu Feb 16 06:25:37 2006 New Revision: 42396

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Georg Brandl
Thomas Heller wrote: Probably a good idea, has been proposed multiple times on clpy. One good thing would be to be able to specify either a default value or a factory function. While at it, other interesting dict subclasses could be: * sorteddict, practically reinvented by every larger

Re: [Python-Dev] Rename str/unicode to text

2006-02-17 Thread Michael Hudson
Guido van Rossum [EMAIL PROTECTED] writes: OTOH, even if we didn't rename str/unicode to text, opentext would still be a good name for the function that opens a text file. Hnnrgh, not really. You're not opening a 'text', nor are you constructing something that might reasonably be called an

Re: [Python-Dev] str object going in Py3K

2006-02-17 Thread Walter Dörwald
Bengt Richter wrote: On Wed, 15 Feb 2006 18:57:26 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: [...] My expectation is that the Py3k standard I/O library will do all of its own conversions on top of binary files anyway -- if you missed it, I'd like to get rid of any ties to C's

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Paul Moore
On 2/17/06, Raymond Hettinger [EMAIL PROTECTED] wrote: Over lunch with Alex Martelli, he proposed that a subclass of dict with this behavior (but implemented in C) would be a good addition to the language I would like to add something like this to the collections module, +1 but a PEP is

Re: [Python-Dev] Off-topic: www.python.org

2006-02-17 Thread Fredrik Lundh
Aahz wrote: In all fairness to Tim (and despite the fact that emotionally I agree with you), the fact is that there had been essentially no forward motion on www.python.org redesign until he went to work. Even if we end up chucking out all his work in favor of something else, I'll consider

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Fuzzyman
Martin v. Lwis wrote: Guido van Rossum wrote: Feedback? I would like this to be part of the standard dictionary type, rather than being a subtype. d.setdefault([]) (one argument) should install a default value, and d.cleardefault() should remove that setting; d.default

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Fredrik Lundh
Guido van Rossum wrote: A bunch of Googlers were discussing the best way of doing the following (a common idiom when maintaining a dict of lists of values relating to a key, sometimes called a multimap): if key not in d: d[key] = [] d[key].append(value) /.../ Feedback? +1. check it

Re: [Python-Dev] Pre-PEP: The bytes object

2006-02-17 Thread Bengt Richter
On Thu, 16 Feb 2006 12:47:22 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: On 2/15/06, Neil Schemenauer [EMAIL PROTECTED] wrote: This could be a replacement for PEP 332. At least I hope it can serve to summarize the previous discussion and help focus on the currently undecided issues.

Re: [Python-Dev] str object going in Py3K

2006-02-17 Thread Guido van Rossum
On 2/15/06, Bengt Richter [EMAIL PROTECTED] wrote: On Wed, 15 Feb 2006 18:57:26 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: My expectation is that the Py3k standard I/O library will do all of its own conversions on top of binary files anyway -- if you missed it, I'd like to get rid of

Re: [Python-Dev] http://www.python.org/dev/doc/devel still available

2006-02-17 Thread Alexander Schremmer
On Wed, 15 Feb 2006 21:13:14 +0100, Georg Brandl wrote: If something like Fredrik's new doc system is adopted, it would be extremely convenient to refer someone to just docs.python.org/os.path.join In fact, PHP does it like php.net/functionname which is even shorter, i.e. they fallback to

Re: [Python-Dev] http://www.python.org/dev/doc/devel still available

2006-02-17 Thread Benji York
Alexander Schremmer wrote: In fact, PHP does it like php.net/functionname which is even shorter, i.e. they fallback to the documentation if that path does not exist otherwise. Like many things PHP, that seems a bit too magical for my tastes. -- Benji York

Re: [Python-Dev] Pre-PEP: The bytes object

2006-02-17 Thread Guido van Rossum
On 2/15/06, Neil Schemenauer [EMAIL PROTECTED] wrote: This could be a replacement for PEP 332. At least I hope it can serve to summarize the previous discussion and help focus on the currently undecided issues. I'm too tired to dig up the rules for assigning it a PEP number. Also, there are

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Thomas Wouters
On Thu, Feb 16, 2006 at 01:11:49PM -0800, Guido van Rossum wrote: Over lunch with Alex Martelli, he proposed that a subclass of dict with this behavior (but implemented in C) would be a good addition to the language. It looks like it wouldn't be hard to implement. It could be a builtin named

Re: [Python-Dev] Rename str/unicode to text

2006-02-17 Thread Fredrik Lundh
Michael Hudson wrote: OTOH, even if we didn't rename str/unicode to text, opentext would still be a good name for the function that opens a text file. Hnnrgh, not really. You're not opening a 'text', nor are you constructing something that might reasonably be called an 'opentext'.

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Fredrik Lundh
Martin v. Löwis wrote: Also, I think has_key/in should return True if there is a default. and keys should return all possible key values! /F ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

[Python-Dev] Deprecate ``multifile``?

2006-02-17 Thread Georg Brandl
Hi, as Jim Jewett noted, multifile is supplanted by email as much as mimify etc. but it is not marked as deprecated. Should it be deprecated in 2.5? Georg ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Pre-PEP: The bytes object

2006-02-17 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/15/06, Neil Schemenauer [EMAIL PROTECTED] wrote: This could be a replacement for PEP 332. At least I hope it can serve to summarize the previous discussion and help focus on the currently undecided issues. I'm too tired to dig up the rules for assigning it a PEP

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Raymond Hettinger
My conclusion is that setdefault() is a failure -- it was a well-intentioned construct, but doesn't actually create more readable code. It was an across the board failure: naming, clarity, efficiency. Can we agree to slate dict.setdefault() to disappear in Py3.0? Raymond

Re: [Python-Dev] str object going in Py3K

2006-02-17 Thread Walter Dörwald
Guido van Rossum wrote: On 2/16/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: What will be the explicit way to open a file in bytes mode and in text mode (I for one would like to move away from open() completely as well) ? Will we have a single file type with two different modes or two

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Phillip J. Eby
At 10:10 AM 02/17/2006 +0100, Georg Brandl wrote: Guido van Rossum wrote: d = DefaultDict([]) can be written as simply d[key].append(value) Feedback? Probably a good idea, has been proposed multiple times on clpy. One good thing would be to be able to specify either a default

Re: [Python-Dev] Deprecate ``multifile``?

2006-02-17 Thread Fredrik Lundh
Georg Brandl wrote: as Jim Jewett noted, multifile is supplanted by email as much as mimify etc. but it is not marked as deprecated. Should it be deprecated in 2.5? -0.5 (gratuitous breakage). I think the current see also/supersedes link is good enough. /F

Re: [Python-Dev] str object going in Py3K

2006-02-17 Thread M.-A. Lemburg
Guido van Rossum wrote: On 2/16/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: What will be the explicit way to open a file in bytes mode and in text mode (I for one would like to move away from open() completely as well) ? Will we have a single file type with two different modes or two

Re: [Python-Dev] Deprecate ``multifile``?

2006-02-17 Thread Georg Brandl
Fredrik Lundh wrote: Georg Brandl wrote: as Jim Jewett noted, multifile is supplanted by email as much as mimify etc. but it is not marked as deprecated. Should it be deprecated in 2.5? -0.5 (gratuitous breakage). I think the current see also/supersedes link is good enough. Well, it

Re: [Python-Dev] str.translate vs unicode.translate

2006-02-17 Thread M.-A. Lemburg
Bengt Richter wrote: If str becomes unicode for PY 3000, and we then have bytes as out coding-agnostic byte data, then I think bytes should have the str translation method, with a tweak that I would hope could also be done to str now. BTW, str.translate will presumably become

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Georg Brandl
Fredrik Lundh wrote: Raymond Hettinger wrote: I would like to add something like this to the collections module, but a PEP is probably needed to deal with issues like: frankly, now that Guido is working 50% on Python, do we really have to use the full PEP process also for simple things

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread M.-A. Lemburg
Martin v. Löwis wrote: Josiah Carlson wrote: I would agree that zip is questionable, but 'uu', 'rot13', perhaps 'hex', and likely a few others that the two of you may be arguing against should stay as encodings, because strictly speaking, they are defined as encodings of data. They may not

Re: [Python-Dev] [Python-checkins] r42396 - peps/trunk/pep-0011.txt

2006-02-17 Thread M.-A. Lemburg
Neal Norwitz wrote: [Moving to python-dev] I don't have a strong opinion. Any one else have an opinion about removing --with-wctype-functions from configure? FWIW, I announced this plan in Dec 2004: http://mail.python.org/pipermail/python-dev/2004-December/050193.html I didn't get any

Re: [Python-Dev] PEP 338 issue finalisation (was Re: 2.5 PEP)

2006-02-17 Thread Nick Coghlan
Guido van Rossum wrote: [Hey, I thought I sent that just to you. Is python-dev really interested in this?] Force of habit on my part - I saw the python-dev header and automatically dropped pyd into the To: field of the reply. Given Paul's contribution on the get_data front, it turned out to

Re: [Python-Dev] The decorator(s) module

2006-02-17 Thread Georg Brandl
Georg Brandl wrote: Hi, it has been proposed before, but there was no conclusive answer last time: is there any chance for 2.5 to include commonly used decorators in a module? No interest at all? Georg ___ Python-Dev mailing list

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Adam Olsen
On 2/16/06, Guido van Rossum [EMAIL PROTECTED] wrote: A bunch of Googlers were discussing the best way of doing the following (a common idiom when maintaining a dict of lists of values relating to a key, sometimes called a multimap): if key not in d: d[key] = [] d[key].append(value) An

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Nick Coghlan
Phillip J. Eby wrote: At 10:10 AM 02/17/2006 +0100, Georg Brandl wrote: Guido van Rossum wrote: d = DefaultDict([]) can be written as simply d[key].append(value) Feedback? Probably a good idea, has been proposed multiple times on clpy. One good thing would be to be able to specify

[Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread Walter Dörwald
M.-A. Lemburg wrote: Walter Dörwald wrote: Guido van Rossum wrote: [...] Years ago I wrote a prototype; checkout sandbox/sio/. However sio.DecodingInputFilter and sio.EncodingOutputFilter don't work for encodings that need state (e.g. when reading/writing UTF-16). Switching to stateful

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Nick Coghlan
Adam Olsen wrote: Over lunch with Alex Martelli, he proposed that a subclass of dict with this behavior (but implemented in C) would be a good addition to the language. It looks like it wouldn't be hard to implement. It could be a builtin named defaultdict. The first, required, argument to the

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Fredrik Lundh
Nick Coghlan wrote: Using Guido's original example: d.get(key, [], True).append(value) hmm. are you sure you didn't just reinvent setdefault ? /F ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread M.-A. Lemburg
Walter Dörwald wrote: M.-A. Lemburg wrote: Walter Dörwald wrote: Guido van Rossum wrote: [...] Years ago I wrote a prototype; checkout sandbox/sio/. However sio.DecodingInputFilter and sio.EncodingOutputFilter don't work for encodings that need state (e.g. when reading/writing UTF-16).

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread skip
Guido Over lunch with Alex Martelli, he proposed that a subclass of Guido dict with this behavior (but implemented in C) would be a good Guido addition to the language. Instead, why not define setdefault() the way it should have been done in the first place? When you create a dict

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Nick Coghlan
Fredrik Lundh wrote: Nick Coghlan wrote: Using Guido's original example: d.get(key, [], True).append(value) hmm. are you sure you didn't just reinvent setdefault ? I'm reasonably sure I copied it on purpose, only with a name that isn't 100% misleading as to what it does ;) I think

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Georg Brandl
[EMAIL PROTECTED] wrote: Guido Over lunch with Alex Martelli, he proposed that a subclass of Guido dict with this behavior (but implemented in C) would be a good Guido addition to the language. Instead, why not define setdefault() the way it should have been done in the first

Re: [Python-Dev] 2.5 PEP

2006-02-17 Thread Fred L. Drake, Jr.
On Thursday 16 February 2006 17:06, Martin v. Löwis wrote: I'm still unhappy with that change, and still nobody has told me how to maintain PyXML so that it can continue to work both for 2.5 and for 2.4. Martin, I do intend to write a proper response for you, but have been massively

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread Walter Dörwald
M.-A. Lemburg wrote: Walter Dörwald wrote: M.-A. Lemburg wrote: [...] Like I suggested in the patch discussion, such functionality could be factored out of the implementations of StreamReaders/Writers and put into new StatefulEncoder/Decoder classes, the objects of which then get used by

Re: [Python-Dev] bytes type discussion

2006-02-17 Thread Bengt Richter
On Fri, 17 Feb 2006 00:43:50 -0500, Steve Holden [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: Barry Warsaw wrote: We know at least there will never be a 2.10, so I think we still have time. because there's no way to count to 10 if you only have one digit? we used to think that back

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Jack Diederich
On Thu, Feb 16, 2006 at 01:11:49PM -0800, Guido van Rossum wrote: [snip] Google has an internal data type called a DefaultDict which gets passed a default value upon construction. Its __getitem__ method, instead of raising KeyError, inserts a shallow copy (!) of the given default value into

Re: [Python-Dev] Please comment on PEP 357 -- adding nb_index slot to PyNumberMethods

2006-02-17 Thread Armin Rigo
Hi Travis, On Tue, Feb 14, 2006 at 08:41:19PM -0700, Travis E. Oliphant wrote: 2) The __index__ special method will have the signature def __index__(self): return obj Where obj must be either an int or a long or another object that has the

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread CM
+1It's about time!- COn 2/16/06, Guido van Rossum [EMAIL PROTECTED] wrote: A bunch of Googlers were discussing the best way of doing thefollowing (a common idiom when maintaining a dict of lists of valuesrelating to a key, sometimes called a multimap):if key not in d: d[key] = []

Re: [Python-Dev] bytes type discussion

2006-02-17 Thread Fredrik Lundh
Bengt Richter wrote: because there's no way to count to 10 if you only have one digit? we used to think that back when the gas price was just below 10 SEK/L, but they found a way... IIRC Guido is on record as saying There will be no Python 2.10 because I hate the ambiguity of

Re: [Python-Dev] Please comment on PEP 357 -- adding nb_index slot to PyNumberMethods

2006-02-17 Thread Thomas Wouters
On Fri, Feb 17, 2006 at 05:29:32PM +0100, Armin Rigo wrote: Where obj must be either an int or a long or another object that has the __index__ special method (but not self). The anything but not self rule is not consistent with any other special method's behavior. IMHO we

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread Walter Dörwald
M.-A. Lemburg wrote: Walter Dörwald wrote: M.-A. Lemburg wrote: Walter Dörwald wrote: [...] So maybe codecs.lookup() should return an instance of a subclass of tuple which has the StatefulEncoder/Decoder as attributes. But then codecs.lookup() must be able to handle old 4-tuples returned

[Python-Dev] Copying zlib compression objects

2006-02-17 Thread Chris AtLee
I'm writing a program in python that creates tar files of a certain maximum size (to fit onto CD/DVD). One of the problems I'm running into is that when using compression, it's pretty much impossible to determine if a file, once added to an archive, will cause the archive size to exceed the

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread Bengt Richter
On Fri, 17 Feb 2006 00:33:49 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= [EMAIL PROTECTED] wrote: Josiah Carlson wrote: I would agree that zip is questionable, but 'uu', 'rot13', perhaps 'hex', and likely a few others that the two of you may be arguing against should stay as encodings,

Re: [Python-Dev] 2.5 release schedule

2006-02-17 Thread Armin Rigo
Hi, On Tue, Feb 14, 2006 at 09:24:57PM -0800, Neal Norwitz wrote: http://www.python.org/peps/pep-0356.html There is at least one SF bug, namely #1333982 Bugs of the new AST compiler, that in my humble opinion absolutely needs to be fixed before the release, even though I won't hide that I have

Re: [Python-Dev] Adventures with ASTs - Inline Lambda

2006-02-17 Thread skip
Steve It appears to hang together, but I'm not sure I see how it Steve overcomes objections to lambda by replacing it with another Steve keyword. Well, it does replace it with a word which has meaning in common English. FWIW, I would require the parens around the arguments and avoid

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Terry Reedy
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Raymond Hettinger wrote: I would like to add something like this to the collections module, but a PEP is probably needed to deal with issues like: frankly, now that Guido is working 50% on Python, do we really have

Re: [Python-Dev] 2.5 release schedule

2006-02-17 Thread Jeremy Hylton
It is critical, but I hadn't seen the bug report. Feel free to assign AST bugs to me and assign them a 5 priority. Jeremy On 2/17/06, Armin Rigo [EMAIL PROTECTED] wrote: Hi, On Tue, Feb 14, 2006 at 09:24:57PM -0800, Neal Norwitz wrote: http://www.python.org/peps/pep-0356.html There is

Re: [Python-Dev] 2.5 release schedule

2006-02-17 Thread Jeremy Hylton
Actually, it might be easier to assign separate bugs. A number of the old bugs appear to have been fixed. It's hard to track individual items within a bug report. Jeremy On 2/17/06, Jeremy Hylton [EMAIL PROTECTED] wrote: It is critical, but I hadn't seen the bug report. Feel free to assign

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Ian Bicking
Raymond Hettinger wrote: Over lunch with Alex Martelli, he proposed that a subclass of dict with this behavior (but implemented in C) would be a good addition to the language I would like to add something like this to the collections module, but a PEP is probably needed to deal with

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Fredrik Lundh
Terry Reedy wrote: I'd say we let the BDFL roam free. PEPs are useful for question-answering purposes even after approval. The design phase can be cut short by simply posting the approved design doc. not for trivialities. it'll take Guido more time to write a PEP than to implement the

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread skip
Also, I think has_key/in should return True if there is a default. Fredrik and keys should return all possible key values! I think keys() and in should reflect reality. Only when you do something like x = d['nonexistent'] or x = d.get('nonexistent') should the default

Re: [Python-Dev] The decorator(s) module

2006-02-17 Thread Ian Bicking
Georg Brandl wrote: Hi, it has been proposed before, but there was no conclusive answer last time: is there any chance for 2.5 to include commonly used decorators in a module? One peculiar aspect is that decorators are a programming technique, not a particular kind of functionality. So the

Re: [Python-Dev] The decorator(s) module

2006-02-17 Thread skip
it has been proposed before, but there was no conclusive answer last time: is there any chance for 2.5 to include commonly used decorators in a module? Georg No interest at all? I would think the decorators that allow proper introspection (func_name, __doc__, etc) should be

Re: [Python-Dev] The decorator(s) module

2006-02-17 Thread Georg Brandl
Ian Bicking wrote: Unfortunately, a @property decorator is impossible... It already works! But only if you want a read-only property. Which is actually about 50%+ of the properties I create. So the status quo is not really that bad. I have abused it this way too and felt bad every

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
On 2/16/06, Guido van Rossum [EMAIL PROTECTED] wrote: Over lunch with Alex Martelli, he proposed that a subclass of dict with this behavior (but implemented in C) would be a good addition to the language. It looks like it wouldn't be hard to implement. It could be a builtin named defaultdict.

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Fred L. Drake, Jr.
On Friday 17 February 2006 14:09, Guido van Rossum wrote: So here's a new proposal. I like the version you came up with. It has sufficient functionality to make it easy to use, and enough flexibility to be useful in more specialized cases. I'm quite certain it would handle all the cases

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Alex Martelli
On 2/16/06, Guido van Rossum [EMAIL PROTECTED] wrote: A bunch of Googlers were discussing the best way of doing the ... Wow, what a great discussion! As you'll recall, I had also mentioned the callable factory as a live possibility, and there seems to be a strong sentiment in favor of that;

[Python-Dev] Counter proposal: multidict (was: Proposal: defaultdict)

2006-02-17 Thread Ian Bicking
I really don't like that defaultdict (or a dict extension) means that x[not_found] will have noticeable side effects. This all seems to be a roundabout way to address one important use case of a dictionary with multiple values for each key, and in the process breaking an important quality of

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
On 2/17/06, Alex Martelli [EMAIL PROTECTED] wrote: On 2/16/06, Guido van Rossum [EMAIL PROTECTED] wrote: A bunch of Googlers were discussing the best way of doing the ... Wow, what a great discussion! As you'll recall, I had also mentioned the callable factory as a live possibility, and

Re: [Python-Dev] Counter proposal: multidict (was: Proposal: defaultdict)

2006-02-17 Thread Guido van Rossum
On 2/17/06, Ian Bicking [EMAIL PROTECTED] wrote: I really don't like that defaultdict (or a dict extension) means that x[not_found] will have noticeable side effects. This all seems to be a roundabout way to address one important use case of a dictionary with multiple values for each key, and

Re: [Python-Dev] Counter proposal: multidict (was: Proposal: defaultdict)

2006-02-17 Thread Fred L. Drake, Jr.
On Friday 17 February 2006 14:51, Ian Bicking wrote: This all seems to be a roundabout way to address one important use case of a dictionary with multiple values for each key, I think there are use cases that do not involve multiple values per key. That is one place where this commonly

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Thomas Heller
Guido van Rossum wrote: So here's a new proposal. Let's add a generic missing-key handling method to the dict class, as well as a default_factory slot initialized to None. The implementation is like this (but in C): def on_missing(self, key): if self.default_factory is not None:

Re: [Python-Dev] Copying zlib compression objects

2006-02-17 Thread Guido van Rossum
Please submit your patch to SourceForge. On 2/17/06, Chris AtLee [EMAIL PROTECTED] wrote: I'm writing a program in python that creates tar files of a certain maximum size (to fit onto CD/DVD). One of the problems I'm running into is that when using compression, it's pretty much impossible

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Thomas Heller
[cc to py-dev again] Guido van Rossum wrote: On 2/17/06, Thomas Heller [EMAIL PROTECTED] wrote: Guido van Rossum wrote: So here's a new proposal. Let's add a generic missing-key handling method to the dict class, as well as a default_factory slot initialized to None. The implementation is

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
On 2/17/06, Thomas Heller [EMAIL PROTECTED] wrote: Ahem, I'm still looking for ways to 'overtake' the dict to implement weird and fancy things. Can on_missing be overridden in subclasses (writing the subclass in C would not be a problem)? Why ahem? The answer is yes. -- --Guido van Rossum

Re: [Python-Dev] Counter proposal: multidict (was: Proposal: defaultdict)

2006-02-17 Thread Jack Diederich
On Fri, Feb 17, 2006 at 03:03:06PM -0500, Fred L. Drake, Jr. wrote: On Friday 17 February 2006 14:51, Ian Bicking wrote: and in the process breaking an important quality of good Python code, that attribute and getitem access not have noticeable side effects. I'm not sure that's quite

Re: [Python-Dev] bytes.from_hex() [Was: PEP 332 revival in coordination with pep 349?]

2006-02-17 Thread Martin v. Löwis
M.-A. Lemburg wrote: Just because some codecs don't fit into the string.decode() or bytes.encode() scenario doesn't mean that these codecs are useless or that the methods should be banned. No. The reason to ban string.decode and bytes.encode is that it confuses users. Regards, Martin

Re: [Python-Dev] Counter proposal: multidict

2006-02-17 Thread Ian Bicking
Guido van Rossum wrote: On 2/17/06, Ian Bicking [EMAIL PROTECTED] wrote: I really don't like that defaultdict (or a dict extension) means that x[not_found] will have noticeable side effects. This all seems to be a roundabout way to address one important use case of a dictionary with multiple

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Ian Bicking
Guido van Rossum wrote: d = {} d.default_factory = set ... d[key].add(value) Another option would be: d = {} d.default_factory = set d.get_default(key).add(value) Unlike .setdefault, this would use a factory associated with the dictionary, and no default value would get passed in.

Re: [Python-Dev] Stateful codecs [Was: str object going in Py3K]

2006-02-17 Thread M.-A. Lemburg
Walter Dörwald wrote: I'd suggest we keep codecs.lookup() the way it is and instead add new functions to the codecs module, e.g. codecs.getencoderobject() and codecs.getdecoderobject(). Changing the codec registration is not much of a problem: we could simply allow 6-tuples to be passed into

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Aahz
On Fri, Feb 17, 2006, Guido van Rossum wrote: But the default implementation is designed so that we can write d = {} d.default_factory = list +1 I actually like the fact that you're forced to use a separate statement for setting the default_factory. From my POV, this can go into 2.5. (I

Re: [Python-Dev] bdist_* to stdlib?

2006-02-17 Thread Guido van Rossum
On 2/16/06, Stephen J. Turnbull [EMAIL PROTECTED] wrote: /usr/share often is on a different mount; that's the whole rationale for /usr/share. I don't think I've worked at a place where something like that was done for at least 10 years. Isn't this argument outdated? -- --Guido van Rossum (home

  1   2   >