Re: [Python-Dev] release plan for 2.5 ?

2006-02-10 Thread Guido van Rossum
On 2/10/06, Neil Schemenauer [EMAIL PROTECTED] wrote: Guido van Rossum [EMAIL PROTECTED] wrote: PEP 349 - str() may return unicode. Where is this? Does that mean you didn't find and read the PEP or was it written so badly that it answered none of your questions? The PEP is on python.org

Re: [Python-Dev] release plan for 2.5 ?

2006-02-10 Thread Guido van Rossum
on fixing that? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
... literal would just add more confusion -- bytes are not characters, but b... makes it appear as if they are. --Guido On 2/11/06, Bengt Richter [EMAIL PROTECTED] wrote: On Fri, 10 Feb 2006 21:35:26 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: On Sat, 11 Feb 2006 05:08:09 + (UTC

Re: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation

2006-02-13 Thread Guido van Rossum
ordinals generally assumed to be non-negative? The numbers used as slice or sequence indices can be negative! Also, I don't buy the reason for 'as'l I don't see how this word would require the conversion to be losless. The PEP continues to use __index__ and I'm happy with that. -- --Guido van Rossum

Re: [Python-Dev] ssize_t branch (Was: release plan for 2.5 ?)

2006-02-13 Thread Guido van Rossum
out-benefits the problems some folks may experience due to the branch not being perfect yet. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python

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

2006-02-13 Thread Guido van Rossum
to help PageRank of the new page.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options

Re: [Python-Dev] moving content around (Re: http://www.python.org/dev/doc/devel still available)

2006-02-13 Thread Guido van Rossum
On 2/13/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Guido van Rossum wrote: (Now that I work for Google I realize more than ever before the importance of keeping URLs stable; PageRank(tm) numbers don't get transferred as quickly as contents. I have this worry too in the context

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
On 2/13/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 09:55 AM 2/13/2006 -0800, Guido van Rossum wrote: One recommendation: for starters, I'd much rather see the bytes type standardized without a literal notation. There should be are lots of ways to create bytes objects from string objects

Re: [Python-Dev] PEP 351

2006-02-13 Thread Guido van Rossum
I've rejected PEP 351, with a reference to this thread as the rationale. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-13 Thread Guido van Rossum
On 2/12/06, Greg Ewing [EMAIL PROTECTED] wrote: [A large head-exploding set of rules] Blarg. Const - Just Say No. +1 -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation

2006-02-13 Thread Guido van Rossum
a TypeError and then checking the message string ... does not seem clean.) I'm not sure what you mean. How could index(x) ever replace isinstance(x, (int, long)) without raising an exception? Surely index(abc) *should* raise an exception. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-13 Thread Guido van Rossum
+1 On 2/13/06, Jeremy Hylton [EMAIL PROTECTED] wrote: It sounds like the right answer for Python is to change the signature of PyArg_ParseTupleAndKeywords() back. We'll fix it when C fixes its const rules wink. Jeremy On 2/13/06, Guido van Rossum [EMAIL PROTECTED] wrote: On 2/12/06

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
On 2/13/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Guido van Rossum wrote: It'd be cruel and unusual punishment though to have to write bytes(abc, Latin-1) I propose that the default encoding (for basestring instances) ought to be ascii just like everywhere else. (Meaning, it should

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
. :) In Py3k, I can see two reasonable approaches to conversion between strings (Unicode) and bytes: always require an explicit encoding, or assume ASCII. Anything else is asking for trouble IMO. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
only the Unicode part will be relevant then. And I think then the encoding should be required or default to ASCII. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
str and bytes as not an encoding but a data type change *only*. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

[Python-Dev] bdist_* to stdlib?

2006-02-13 Thread Guido van Rossum
(not setuplib as I mistakenly called it previously)? (I'm still a bit unclear on the various concepts here, not having made a distribution of anything in a very long time...) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev

Re: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation

2006-02-13 Thread Guido van Rossum
Sorry, you're right. operator.index() sounds fine. --Guido On 2/13/06, Alex Martelli [EMAIL PROTECTED] wrote: On 2/13/06, Guido van Rossum [EMAIL PROTECTED] wrote: ... I don't like to add a built-in index() at this point; mostly because of Occam's razor (we haven't found a need). I

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
agree that string to bytes shouldn't change the value of the bytes. It's a deal then. Can the owner of PEP 332 update the PEP to record these decisions? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
are being taken, from isinstance(x, (list, tuple)) to isinstance(x, basestring).) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
with a single byte of value 0x80. Yes to both again. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-13 Thread Guido van Rossum
On 2/13/06, Neil Schemenauer [EMAIL PROTECTED] wrote: Guido van Rossum [EMAIL PROTECTED] wrote: In py3k, when the str object is eliminated, then what do you have? Perhaps - bytes(\x80), you get an error, encoding is required. There is no such thing as default encoding anymore, as there's

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

2006-02-14 Thread Guido van Rossum
perhaps we'd be using openbinary(filename, 'w)). Perhaps write(somedata) should automatically coerce the data to bytes? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

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

2006-02-14 Thread Guido van Rossum
another bdist_msi release before contributing it to Python. Please go ahead. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

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

2006-02-14 Thread Guido van Rossum
On 2/14/06, Just van Rossum [EMAIL PROTECTED] wrote: Guido van Rossum wrote: [...] surely text files are more commonly used, and surely the most common operation should have the shorter name -- call it the Huffman Principle. +1 for two functions. My choice would be open() for binary

[Python-Dev] bytes type discussion

2006-02-14 Thread Guido van Rossum
) as the only way to convert a string (which is always unicode) to bytes. The problem with this is that there's no code that works in both 2.x and 3.0. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
On 2/14/06, Thomas Wouters [EMAIL PROTECTED] wrote: On Mon, Feb 13, 2006 at 03:44:27PM -0800, Guido van Rossum wrote: But adding an encoding doesn't help. The str.encode() method always assumes that the string itself is ASCII-encoded, and that's not good enough: abc.encode(latin-1

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
recursively and telling them what file to print to, rather than getting a temporary string from them and printing that. I always wondered why you could do that from C extensions but not from Python code. I want to keep the Python-level API small. -- --Guido van Rossum (home page: http://www.python.org

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
). -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
. I'm not sure I understand your silent errors fear; can you elaborate? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
On 2/13/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 04:29 PM 2/13/2006 -0800, Guido van Rossum wrote: On 2/13/06, Phillip J. Eby [EMAIL PROTECTED] wrote: I didn't mean that it was the only purpose. In Python 2.x, practical code has to sometimes deal with string-like objects

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
(some_bytes_object) is bytes? Yes. But that doesn't constrain the API much. Anyway, I'm now convinced that bytes should act as an array of ints, where the ints are restricted to range(0, 256) but have type int. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
be internally implemented by creating a new bytes object each time. Perhaps the implementation effort isn't so minimal after all... (PS why is there a reply-to in your email the excludes you from the list of recipients but includes me?) -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] byte literals unnecessary [Was: PEP 332 revival in coordination with pep 349?]

2006-02-14 Thread Guido van Rossum
On 2/14/06, Neil Schemenauer [EMAIL PROTECTED] wrote: Maybe you should ask your coworkers. :-) I think gmail is trying to do something intelligent with the Mail-Followup-To header. But you're the only person for whom it does that. Do you have a funny gmail setting? -- --Guido van Rossum (home

Re: [Python-Dev] bytes type discussion

2006-02-14 Thread Guido van Rossum
On 2/14/06, Bob Ippolito [EMAIL PROTECTED] wrote: On Feb 14, 2006, at 3:13 PM, Guido van Rossum wrote: - we need a new PEP; PEP 332 won't cut it - no b... literal - bytes objects are mutable - bytes objects are composed of ints in range(256) - you can pass any iterable of ints

Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]

2006-02-14 Thread Guido van Rossum
underlying array is allocated inline with the str header, this require str and bytes to have the same object layout. But since bytes are mutable, they can't. Summary: you don't understand the implementation well enough to suggest these kinds of things. -- --Guido van Rossum (home page: http

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

2006-02-15 Thread Guido van Rossum
and the latter is wrong in 3.0). I'm tempting to hold out for open() since it's most compatible. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

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

2006-02-15 Thread Guido van Rossum
the situation or make it worse ? I'm not worried about this scenario. What if all the programmers in the world suddenly became dumb? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

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

2006-02-15 Thread Guido van Rossum
probably be a mistake. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev

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

2006-02-15 Thread Guido van Rossum
On 2/15/06, Tim Parkin [EMAIL PROTECTED] wrote: Guido van Rossum wrote: (Now that I work for Google I realize more than ever before the importance of keeping URLs stable; PageRank(tm) numbers don't get transferred as quickly as contents. I have this worry too in the context

Re: [Python-Dev] Generalizing *args and **kwargs

2006-02-15 Thread Guido van Rossum
currently not able to give much thought to any more new proposals, so don't expect me to look at it any time soon. Unless a miracle occurs it's off the table for 2.5 so there's no hurry. -- --Guido van Rossum (home page: http://www.python.org/~guido

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

2006-02-15 Thread Guido van Rossum
On 2/15/06, Bill Janssen [EMAIL PROTECTED] wrote: The default behavior of the current open() in opening files as text is particularly grating. Why? Are you perhaps one of those rare folks who read more binary data than text? -- --Guido van Rossum (home page: http://www.python.org/~guido

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

2006-02-15 Thread Guido van Rossum
looking for, but for backwards compatibility we can't change the default on Windows in Python 2.x, so the point is moot until 3.0 or until a new binary file API is added to 2.x. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python

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

2006-02-15 Thread Guido van Rossum
idea. (Hence the movement to have separate opentext and openbinary or openbytes functions.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python

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

2006-02-15 Thread Guido van Rossum
/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido

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

2006-02-15 Thread Guido van Rossum
is that every OS with any kind of text support has a way to get this info -- even if it's as rudimentary as it's always ASCII (v7 Unix :-) or it's always UTF-8 (I am hoping this will eventually be the answer in the distant future). -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] bytes type discussion

2006-02-15 Thread Guido van Rossum
/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] ssize_t branch merged

2006-02-15 Thread Guido van Rossum
___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] from __future__ import unicode_strings?

2006-02-15 Thread Guido van Rossum
. :-) It's probably easier to do that by placing a line str = unicode at the top of the file. Of course (like a good per-module switch should!) this won't affect code in other modules that you invoke so it's not clear that it always does the right thing. But it's a start. -- --Guido van Rossum

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

2006-02-15 Thread Guido van Rossum
On 2/15/06, Greg Ewing [EMAIL PROTECTED] wrote: Guido van Rossum wrote: So how about openbytes? This clearly links the resulting object with the bytes type, which is mutually reassuring. That looks quite nice. Another thought -- what is going to happen to os.open? Will it change

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

2006-02-16 Thread Guido van Rossum
On 2/16/06, Nick Coghlan [EMAIL PROTECTED] wrote: Guido van Rossum wrote: Do you have unit tests for everything? I believe I fixed a bug in the code that reads a bytecode file (it wasn't skipping the timestamp). [Hey, I thought I sent that just to you. Is python-dev really interested

[Python-Dev] Proposal: defaultdict

2006-02-16 Thread Guido van Rossum
there - d.default should be a read-only attribute giving the default value Feedback? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

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

2006-02-16 Thread Guido van Rossum
data, even Unix programmers will be using openbytes() from the start. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Rename str/unicode to text [Was: Re: str object going in Py3K]

2006-02-16 Thread Guido van Rossum
still be a good name for the function that opens a text file. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

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

2006-02-16 Thread Guido van Rossum
of sorts). Years ago I wrote a prototype; checkout sandbox/sio/. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

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] 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

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

2006-02-17 Thread Guido van Rossum
, other): if isinstance(other, array): return bytes(super(bytes, self).__add__(other)) return NotImplemented -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

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 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

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

2006-02-17 Thread Guido van Rossum
about dicts of dicts, dicts of sets, dicts of user-defined objects? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Copying zlib compression objects

2006-02-17 Thread Guido van Rossum
/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev

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] 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

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
can avoid this kind of confusion -- I could have given you some other mapping object that does weird stuff. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
On 2/17/06, Ian Bicking [EMAIL PROTECTED] wrote: 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

Re: [Python-Dev] Serial function call composition syntax foo(x, y) - bar() - baz(z)

2006-02-17 Thread Guido van Rossum
Cut to the chase: -1000. On 2/17/06, Bengt Richter [EMAIL PROTECTED] wrote: Cut to the chase: how about being able to write baz(bar(foo(x, y)),z) serially as foo(x, y) - bar() - baz(z) via the above as sugar for baz.__get__(bar.__get__(foo(x, y))())(z) ? -- --Guido van

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

2006-02-17 Thread Guido van Rossum
On 2/17/06, Martin v. Löwis [EMAIL PROTECTED] wrote: Guido van Rossum wrote: 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

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
that would break this way. I believe that *most* code that takes a dict will work just fine if that dict has a default factory. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Serial function call composition syntax foo(x, y) - bar() - baz(z)

2006-02-17 Thread Guido van Rossum
Richter On Fri, 17 Feb 2006 14:17:41 -0800, Guido van Rossum [EMAIL PROTECTED] wrote: Cut to the chase: -1000. On 2/17/06, Bengt Richter [EMAIL PROTECTED] wrote: Cut to the chase: how about being able to write baz(bar(foo(x, y)),z) serially as foo(x, y) - bar() - baz(z

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
/sf/1433928 So there's no excuse to be practical now. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Guido van Rossum
Martin and your proposed semantics, you'd have to write if d.get(key): print whatever or (worse) if d[key]: # inserts an empty list into the dict! print whatever I'd much rather be able to write if key in d and get the result I want... -- --Guido van Rossum (home page: http

Re: [Python-Dev] Removing Non-Unicode Support?

2006-02-19 Thread Guido van Rossum
know of any embedded platform that doesn't have unicode support as a requirement? Python runs fine on Nokia phones running Symbian, where *everything* is a Unicode string. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev

Re: [Python-Dev] buildbot is all green

2006-02-19 Thread Guido van Rossum
wasting a lot of horizontal space in the first two columns the second is almost always empty. Perhaps the author of the change could be placed *below* the timestamp instead of next to it? Also for all practical purposes we can probably get rid of the seconds in the timestamp. -- --Guido van Rossum

[Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
instead of with the call site. Let the third round of the games begin! -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

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

2006-02-20 Thread Guido van Rossum
for 2.3 but unless you also provide a patch it's unlikely to be fixed; the memory allocation code was revamped significantly for 2.4 so there's no simple backport of the fix available. (*) d = {} for i in range(10): d[repr(i)] = i s = str(d) while 1: x = eval(s); print 'x' -- --Guido van Rossum

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
On 2/20/06, Raymond Hettinger [EMAIL PROTECTED] wrote: [GvR] Alternative A: add a new method to the dict type with the semantics of __getattr__ from the last proposal Did you mean __getitem__? Yes, sorry, I meant __getitem__. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Simple CPython stack overflow.

2006-02-20 Thread Guido van Rossum
://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
On 2/20/06, Steven Bethard [EMAIL PROTECTED] wrote: Guido van Rossum wrote: Alternative A: add a new method to the dict type with the semantics of [__getitem__] from the last proposal, using default_factory if not None (except on_missing is inlined). I'm not certain I understood

Re: [Python-Dev] Proposal: defaultdict

2006-02-20 Thread Guido van Rossum
This is actually a fairly powerful argument for a subclass that redefines __getitem__ in favor of a new dict method. (Not to mention that it's much easier to pick a name for the subclass than for the method. :-) See the new thread I started. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
with deprecating them all; most likely we'll have to have some kind of (semi-)automatic conversion tool. Deprecation in 2.x is generally done to indicate that a feature will be removed in 2.y for y = x+1. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
believe that this is as easy as you think. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
On 2/20/06, Alex Martelli [EMAIL PROTECTED] wrote: On Feb 20, 2006, at 12:33 PM, Guido van Rossum wrote: ... You don't need a new feature for that use case; d[k] = d.get(k, 0) + 1 is perfectly fine there and hard to improve upon. I see d[k]+=1 as a substantial improvement

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
to *create* an object. As the *user* of an object you're not allowed to *create* another instance (unless the object provides an explicit API to do so, of course, in which case you deal with that API's signature, not with the constructor). -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
to write to customize the behavior; it also reduces worries about how to call the superclass __getitem__ method (catching KeyError *might* catch an unrelated KeyError caused by a bug in the key's __hash__ or __eq__ method). -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] defaultdict proposal round three

2006-02-20 Thread Guido van Rossum
On 2/20/06, Guido van Rossum [EMAIL PROTECTED] wrote: [stuff with typos] Here's the proofread version: I have a patch ready that implements this. I've assigned it to Raymond for review. I'm just reusing the same SF patch as before: http://python.org/sf/1433928 . One subtlety: for maximal

Re: [Python-Dev] defaultdict proposal round three

2006-02-21 Thread Guido van Rossum
for a while? I recommend that you sit back, relax for a season, and reflect on the zen nature of Pythonicity. Then come back and hopefully you'll be able to post without embarrassing yourself continuously. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] defaultdict proposal round three

2006-02-21 Thread Guido van Rossum
van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] defaultdict proposal round three

2006-02-21 Thread Guido van Rossum
. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

[Python-Dev] Fixing copy.py to allow copying functions

2006-02-21 Thread Guido van Rossum
[types.BuiltinFunctionType] = _deepcopy_atomic +d[types.FunctionType] = _deepcopy_atomic def _deepcopy_list(x, memo): y = [] Any objections? Given that these are picklable, I can't imagine there are any but I thought I'd ask anyway. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] defaultdict and on_missing()

2006-02-22 Thread Guido van Rossum
raise this, and in that case it would be a mistake to call on_missing(). IMO pretty much the only reason for keeping the changes contained within the collections module would be code modularity; but the above argument about code reuse deconstructs that argument. -- --Guido van Rossum (home page

Re: [Python-Dev] defaultdict and on_missing()

2006-02-22 Thread Guido van Rossum
On 2/22/06, Raymond Hettinger [EMAIL PROTECTED] wrote: [Guido van Rossum] If we removed on_missing() from dict, we'd have to override __getitem__ in defaultdict (regardless of whether we give defaultdict an on_missing() hook or in-line it). You have another option. Keep your current

Re: [Python-Dev] defaultdict and on_missing()

2006-02-23 Thread Guido van Rossum
? Good point. I'll call it __missing__. I've uploaded a new patch to python.org/sf/1433928. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] PEP 328

2006-02-25 Thread Guido van Rossum
the decisions. If we were wrong (which I doubt) we'll have the opportunity to take a different direction in 2.6. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] cProfile prints to stdout?

2006-02-25 Thread Guido van Rossum
to a file with a simple file. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev

Re: [Python-Dev] cProfile prints to stdout?

2006-02-25 Thread Guido van Rossum
file. It is currently impossible to separate profile output from the program's output. It is if you use the advanced use of the profiler -- the profiling run just saves the profiling data to a file, and the pstats module invoked separately prints the output. -- --Guido van Rossum (home page

Re: [Python-Dev] defaultdict and on_missing()

2006-02-25 Thread Guido van Rossum
FWIW this has now been checked in. Enjoy! --Guido On 2/23/06, Guido van Rossum [EMAIL PROTECTED] wrote: On 2/22/06, Michael Chermside [EMAIL PROTECTED] wrote: A minor related point about on_missing(): Haven't we learned from regrets over the .next() method of iterators that all

Re: [Python-Dev] defaultdict and on_missing()

2006-02-28 Thread Guido van Rossum
level. The C implementation doesn't take an argument. Adding an argument would cause all sorts of code breakage and possible segfaults (if there's 3rd party code calling tp_next for example). In 3.0 we could fix this. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] with-statement heads-up

2006-02-28 Thread Guido van Rossum
On 2/28/06, Mike Bland [EMAIL PROTECTED] wrote: On 2/28/06, Guido van Rossum [EMAIL PROTECTED] wrote: I just realized that there's a bug in the with-statement as currently checked in. __exit__ is supposed to re-raise the exception if there was one; if it returns normally, the finally clause

Re: [Python-Dev] with-statement heads-up

2006-02-28 Thread Guido van Rossum
On 2/28/06, Mike Bland [EMAIL PROTECTED] wrote: On 2/28/06, Guido van Rossum [EMAIL PROTECTED] wrote: On 2/28/06, Mike Bland [EMAIL PROTECTED] wrote: On 2/28/06, Guido van Rossum [EMAIL PROTECTED] wrote: I just realized that there's a bug in the with-statement as currently checked

<    2   3   4   5   6   7   8   9   10   11   >