Re: [Python-3000] More batteries included!

2006-04-27 Thread Giovanni Bajo
Nick Coghlan <[EMAIL PROTECTED]> wrote: >> How about including wxPython[1] and Wax[2] in the Py3k standard libs >> and getting rid of the TK gui stuff? >> >> Also, I think pywin32[3] should be included. Or is there already a >> way to use Windows COM objects in Python that I missed? >> >> PIL[4] w

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Georg Brandl
Kay Schluehr wrote: > Talin schrieb: > >>A set with no elements is: >> >> set() >> >>Alternatively, you could take the tuple idea one step further: >> >> {,} >> >> > If you want to simulate the mathematical notion of an empty set I would > say that {/} has a stronger mnemonic appeal. It al

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Greg Wilson
> A set with no elements is: >set() I prefer Guido's earlier suggestion of {/} for the empty set (assuming no parsing ambiguities?): a) requiring 'set()' for empty sets is inconsistent with (), [], {} for empty collections of other kinds b) {/} kind of looks like phi (circle with a slash

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Gareth McCaughan
On Thursday 2006-04-27 11:42, Georg Brandl wrote: > Kay Schluehr wrote: ... > > Furthermore: what about notions of infinite sets? > > Can you elaborate on that? Seems to me that if you want infinite sets, you want some type other than "set". Ah, the wonders of duck typing. (Just as if you want ma

Re: [Python-3000] rough draft signature PEP

2006-04-27 Thread Nick Coghlan
Michael Chermside wrote: > Brett responds: >> Yeah, I see what you are saying. But I actually held this view long >> before Iearned how Python did things underneath the covers. >> >> I have no clue how people tend to view things. Anyone else care to >> comment on how they tend to see arguments? >

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Nick Coghlan
Greg Wilson wrote: >> A set with no elements is: >>set() > > I prefer Guido's earlier suggestion of {/} for the empty set (assuming no > parsing ambiguities?): I believe the leading '{' should be enough to clue the parser in to what's going on (i.e. '{/' is currently a syntax error) I think

Re: [Python-3000] Python-3000 Digest, Vol 2, Issue 151

2006-04-27 Thread Nick Coghlan
Guido van Rossum wrote: > On 4/26/06, Antoine Pitrou <[EMAIL PROTECTED]> wrote: >> 1) sets are most often built dynamically rather than statically (in my >> own experience) > > The same is true to the same extent for lists and dicts. > > And yet there are many uses for list and dict literals. >

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Ivan Krstic
Nick Coghlan wrote: > I think I'm a convert - +1 for set literals, with {/} for the empty set. I'm +1 on set literals, but -1 on {/} for the empty set. I much prefer set() -- {/} seems too Perlesque and magical-looking. I don't think we have three subsequent punctuation marks as an atom anywhere e

[Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Nick Coghlan
Georg just added the idea of automatically invoking str() in str.join() to PEP 3100 with a question mark on the end. I thought I'd responded when Talin first brought it up, but couldn't find a record of that in the archive (this is why one suggestion per message is a good idea ;) I tried to imp

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Nick Coghlan
Ivan Krstic wrote: > Nick Coghlan wrote: >> I think I'm a convert - +1 for set literals, with {/} for the empty set. > > I'm +1 on set literals, but -1 on {/} for the empty set. I much prefer > set() -- {/} seems too Perlesque and magical-looking. I could certainly live with set(). The ASCII-art

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Georg Brandl
Nick Coghlan wrote: > Georg just added the idea of automatically invoking str() in str.join() to > PEP > 3100 with a question mark on the end. I thought I'd responded when Talin > first > brought it up, but couldn't find a record of that in the archive (this is why > one suggestion per message

Re: [Python-3000] More batteries included!

2006-04-27 Thread Fredrik Lundh
Giovanni Bajo wrote: > > Since this is still well into the future, by the time Py3k rolls > > around it might be possible to include the option of easy-installing > > various packages from the Python installer. > > As usually said, this would be miss the *main* point of having a standard > library

Re: [Python-3000] Stackable Blocks

2006-04-27 Thread Georg Brandl
Crutcher Dunnavant wrote: > Having been shot down so hard on my request to bring for loops into > symetry with list comprehensions, I have a new proposal - stackable > blocks. > > This is a very _small_ amount of syntax sugar, the basic idea is that > any block headers can be stacked on the same l

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Fredrik Lundh
Georg Brandl wrote: > As a side note, I named the thing "string.join()" because I didn't know what > to > write. join() it's time to make this a builtin. the "it's the separator that's doing the joining" idea is silly and unintuitive, and should be fixed. _

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Ivan Krstic
Fredrik Lundh wrote: > it's time to make this a builtin. the "it's the separator that's doing the > joining" idea is silly and unintuitive, and should be fixed. +1 on this; I've thought this for a long time. -- Ivan Krstic <[EMAIL PROTECTED]> | GPG: 0x147C722D __

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Raymond Hettinger
Ivan Krstic wrote: >Fredrik Lundh wrote: > > >>it's time to make this a builtin. the "it's the separator that's doing the >>joining" idea is silly and unintuitive, and should be fixed. >> >> > >+1 on this; I've thought this for a long time. > > > Strong +1. This fixes a long-standing micr

Re: [Python-3000] rough draft signature PEP

2006-04-27 Thread Talin
Nick Coghlan gmail.com> writes: > > My mental model matches Brett's. > > I think of them as separate things, too. Separate attributes also makes it > easier to add additional metadata later, and the structure of each attribute > can be well-defined. > > For example, given: > > def f(req:int,

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Aahz
On Thu, Apr 27, 2006, Raymond Hettinger wrote: > Ivan Krstic wrote: >>Fredrik Lundh wrote: >>> >>>it's time to make this a builtin. the "it's the separator that's doing the >>>joining" idea is silly and unintuitive, and should be fixed. >> >>+1 on this; I've thought this for a long time. > > Stron

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > While I hate the way it looks, I never have gotten mixed up about the > order of arguments since switching to ''.join(l). Which is why EMPTYSTRING = '' ... EMPTYSTRING.join(seq) looks much better. But hey, yeah, a join() builtin would be fine

Re: [Python-3000] Python-3000 Digest, Vol 2, Issue 151

2006-04-27 Thread Giovanni Bajo
Nick Coghlan wrote: > Another point in favour of set literals is that they let an optimising > compiler play games because the compiler knows that the contents of > that literal are supposed to be hashable, even if it can't resolve > them right now, and it knows that the result is going to be an a

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Alex Martelli
On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > While I hate the way it looks, I never have gotten mixed up about the > > order of arguments since switching to ''.join(l). > > Which is why > > EMPTYSTRING = '' > > ... > > EMPTYSTRING.join(s

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Hochberg
Barry Warsaw wrote: > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: >> -0 >> >> >>While I hate the way it looks, I never have gotten mixed up about the >>order of arguments since switching to ''.join(l). Me too on all counts including the -0. > > > Which is why > > EMPTYSTRING = '' > > ..

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Guido van Rossum
On 4/27/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > As a side note, I named the thing "string.join()" because I didn't know what > to > write. The str type will be dead, and I assume that the new string type will > have a different name. > > Will it be "unicode"? Or "text"? Or "string"? "str" o

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Peters
[Barry Warsaw] >> ... >> While I hate the way it looks, I never have gotten mixed up about the >> order of arguments since switching to ''.join(l). [Tim Hochberg] > Me too on all counts including the -0. >> ... >> But hey, yeah, a join() builtin would be fine if it >> took the string arg first, s

[Python-3000] the dict constructor

2006-04-27 Thread Steven Bethard
On 4/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > ... the dict constructor signature is > already too far overloaded, giving a different meaning to keyword > args, and distinguishing between a mapping and a sequence is iffy: it > requires a "keys" method which is kind of sub-optimal compare

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Fredrik Lundh
Tim Peters wrote: > > In which case why would we need a builtin? > > Because people enjoy arguing about the best order for the arguments, > and about the best default separator value, neither of which you _can_ > argue about in the method spelling ;-) no, because people enjoy writing readable cod

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Phillip J. Eby
At 07:16 PM 4/27/2006 +0200, Barry Warsaw <[EMAIL PROTECTED]> wrote: > But hey, yeah, a join() builtin would be fine if it >took the string arg first, so that > >''.join(seq) == join('', seq) And thanks to the time machine, str.join('', seq) does this already: Python 2.2.2 (#1, Feb 24 2003, 19:1

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Raymond Hettinger
[pep-3100 checkin] > {F(x) for x in S if P(x)} means set(F(x) for x in S if P(x)). I presume this means that there will never be dictionary comprehensions (as they would aspire to have an identical notation). > There's no frozenset literal; they are too rarely needed. Actually, they are one

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Peters
[Fredrik Lundh] > no, because people enjoy writing readable code. doing things by exe- > cuting methods attached to literals isn't very readable, and isn't used > for anything else. As Barry often says, he spells it TAB.join() or BLANK.join() (etc) instead. That's very readable. > I don't think

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Steven Bethard
On 4/27/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [pep-3100 checkin] > > {F(x) for x in S if P(x)} means set(F(x) for x in S if P(x)). > > I presume this means that there will never be dictionary > comprehensions (as they would aspire to have an identical > notation). Why would that be n

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Fredrik Lundh
Phillip J. Eby wrote: > And thanks to the time machine, str.join('', seq) does this already: > > Python 2.2.2 (#1, Feb 24 2003, 19:13:11) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> str.join('',['a','b','c

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Jack Diederich
On Thu, Apr 27, 2006 at 10:18:23AM -0700, Alex Martelli wrote: > On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > > > While I hate the way it looks, I never have gotten mixed up about the > > > order of arguments since switching to ''.join

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Steven Bethard
On 4/27/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Phillip J. Eby wrote: > > > And thanks to the time machine, str.join('', seq) does this already: > > > > Python 2.2.2 (#1, Feb 24 2003, 19:13:11) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2 > > Type "help", "copyright", "credits"

Re: [Python-3000] More batteries included!

2006-04-27 Thread Terry Reedy
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hopefully, the Py3K distributors will use semi-automatic tools to > download > all they need to build a battery-included release. pushing all that over > to > the end users would be a major mistake. > (python-dev and

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Ron Adam
Raymond Hettinger wrote: > [pep-3100 checkin] >> {F(x) for x in S if P(x)} means set(F(x) for x in S if P(x)). > > I presume this means that there will never be dictionary comprehensions (as > they would aspire to have an identical notation). > > > >> There's no frozenset literal; they are t

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Guido van Rossum
On 4/27/06, Ron Adam <[EMAIL PROTECTED]> wrote: > I think it's been suggested before that there should be a PY2.x to PY3.x > conversion utility to facilitate the move to PY3K. So maybe a sticking > point as when to *not* do something would be, if it's not possible to > translate a changed 2.x feat

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 11:49 -0700, Raymond Hettinger wrote: > [pep-3100 checkin] > > {F(x) for x in S if P(x)} means set(F(x) for x in S if P(x)). > > I presume this means that there will never be dictionary > comprehensions (as they would aspire to have an identical notation). > > > > > Ther

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 12:57 -0600, Steven Bethard wrote: > On 4/27/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > [pep-3100 checkin] > > > {F(x) for x in S if P(x)} means set(F(x) for x in S if P(x)). > > > > I presume this means that there will never be dictionary > > comprehensions (as the

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 16:44 -0400, Barry Warsaw wrote: > for x in (1, 2, 3, 5, 7, 11) Uh, ignore that. Order matters. -Barry signature.asc Description: This is a digitally signed message part ___ Python-3000 mailing list Python-3000@python.org

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Ron Adam
Guido van Rossum wrote: > On 4/27/06, Ron Adam <[EMAIL PROTECTED]> wrote: >> I think it's been suggested before that there should be a PY2.x to PY3.x >> conversion utility to facilitate the move to PY3K. So maybe a sticking >> point as when to *not* do something would be, if it's not possible to >

[Python-3000] PEP 3002 (Procedure for Backwards-Incompatible Changes)

2006-04-27 Thread Guido van Rossum
I just read PEP 3002 and while I like most of what I see (thanks Steven Bethard!) there's one section that stands out as problematic. I'm quoting it here: """ Optional Extensions === Instead of the python3warn.py script, a branch of Python 3000 could be maintained that added warni

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Baptiste Carvello
Ron Adam a écrit : > Raymond Hettinger wrote: >>I forsee {} vs {/} as being a prominent entry on everyone's list of Python >>pitfalls, faqs, and common errors. Maybe PyLint or PyChecker will be able to >>scan to see how the object is used and determine whether the two were >>mixed-up. >> > > I

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Eli Stevens (WG.c)
Barry Warsaw wrote: > Okay, radical/insane/heretical question time: do we really need literal > tuple syntax? IOW, what if (1, 2, 3) created a frozenset instead of a > tuple? > > Or perhaps an even stupider idea: what if the compiler could recognize > certain use cases and generate different type

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Talin
Barry Warsaw python.org> writes: > Or perhaps an even stupider idea: what if the compiler could recognize > certain use cases and generate different types depending on how the > object is used. Hey! If anyone is going to post stupid ideas to this list, it's gonne be ME! Got that? Speaking of w

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 16:05 -0700, Eli Stevens (WG.c) wrote: > I think you'd have to create a tuple, and convert it to a set on the > fly. Which should x be in the following: > > x = (1, 2, 1) > dictOfCallables["foo"](x) Well here's another nutty idea. We actually have two ways to create lite

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Barry Warsaw
On Thu, 2006-04-27 at 10:18 -0700, Alex Martelli wrote: > > ''.join(seq) == join('', seq) > > I think I would prefer a signature of: > join(seq, joiner='') Except that I think it would be a mistake to have that and keep the .join() method on strings because that would increase the confusion

Re: [Python-3000] Stackable Blocks

2006-04-27 Thread Crutcher Dunnavant
On 4/27/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > Crutcher Dunnavant wrote: > > Having been shot down so hard on my request to bring for loops into > > symetry with list comprehensions, I have a new proposal - stackable > > blocks. > > > > This is a very _small_ amount of syntax sugar, the basi

Re: [Python-3000] sets in P3K?

2006-04-27 Thread skip
Baptiste> Actually I think we need both {/} as the empty set and {:} as Baptiste> the empty dict. Baptiste> {} should raise SyntaxError, '{} is ambiguous, use {/} for Baptiste> set, {:} for dict' Piggybacking on this post and Barry's heretical ideas, (/) looks more like the null

Re: [Python-3000] sets in P3K?

2006-04-27 Thread skip
Barry> x = 1, 2, 3 Barry> x = (1, 2, 3) Barry> So let's keep the first and hijack the second to be set Barry> constructor notation. This is a fairly common error: x = 1, For that reason I prefer to always use parens for tuple literals. Skip

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Tim Peters
[Alex Martelli, suggests that a functional join's default separator be the empty string] >> Rationale: an emptystring joiner is the most frequent cases, but >> several others (space, newline, space-comma, ...) occur often enough >> to be worth allowing the joiner to be optionally specified. [Barr

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Brett Cannon
On 4/27/06, Tim Peters <[EMAIL PROTECTED]> wrote: > [Fredrik Lundh] > > no, because people enjoy writing readable code. doing things by exe- > > cuting methods attached to literals isn't very readable, and isn't used > > for anything else. > > As Barry often says, he spells it TAB.join() or BLANK.

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Crutcher Dunnavant
On 4/27/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > On 4/27/06, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-04-27 at 10:08 -0700, Aahz wrote: > > > > > While I hate the way it looks, I never have gotten mixed up about the > > > order of arguments since switching to ''.join(l). > > >

[Python-3000] Make it easier to port to small devices.

2006-04-27 Thread Blake Winton
Specifically, I'm thinking of the 300MHz Palm TX sitting on the table beside me, which should be more than powerful enough to run Python, but in general I think it should be easier to cross-compile Python for new architectures. I've taken a stab at it, and perhaps it's because I don't have eno

Re: [Python-3000] Make it easier to port to small devices.

2006-04-27 Thread Neal Norwitz
Blake, What problems did you have? There is a patch or two up on SF that address some of the issues. I know of some problems, but we don't have a volunteer to work on these issues. So if you could be that volunteer, maybe we could solve this problem. Not for 3.0 in the future, but for 2.5 toda

Re: [Python-3000] rough draft signature PEP

2006-04-27 Thread Brett Cannon
On 4/27/06, Talin <[EMAIL PROTECTED]> wrote: > Nick Coghlan gmail.com> writes: > > > > My mental model matches Brett's. > > > > I think of them as separate things, too. Separate attributes also makes it > > easier to add additional metadata later, and the structure of each attribute > > can be wel

[Python-3000] Add a standard GUI system

2006-04-27 Thread Bill Janssen
I mentioned this a couple of weeks ago, and here it is again. The biggest wart in Python 2, the one that forces me to use another language, is the lack of a standard GUI. By standard, I mean that when you install Python on a system, the GUI toolkit is also installed. I suggest that for Python 3K

Re: [Python-3000] Automatically invoking str() in str.join()

2006-04-27 Thread Terry Reedy
"Brett Cannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I wouldn't want it added without ditching the other two versions as > well. Personally I would be fine if string.join() stayed and we > considered removing str.join() and just made the string module more > prominent (af

Re: [Python-3000] Stackable Blocks

2006-04-27 Thread Terry Reedy
"Crutcher Dunnavant" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I don't really care how it gets spelled. In the current system, I > _have_ to break the context spec up on multiple lines, I consider that a plus. It is part of Python's basic indented statement structure, which

Re: [Python-3000] Stackable Blocks

2006-04-27 Thread Crutcher Dunnavant
On 4/27/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Crutcher Dunnavant" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I don't really care how it gets spelled. In the current system, I > > _have_ to break the context spec up on multiple lines, > > I consider that a plus. It

Re: [Python-3000] sets in P3K?

2006-04-27 Thread Kay Schluehr
[EMAIL PROTECTED] schrieb: >Piggybacking on this post and Barry's heretical ideas, (/) looks more like >the null set to me... Actually, if Py3k is going to be Unicode only, why >not use Ø as the null set? ;-) > > Yes, Py3K + Unicode rulez! I'm +1 on this but not before having a Py3K keyboard :

Re: [Python-3000] PEP 3002 (Procedure for Backwards-Incompatible Changes)

2006-04-27 Thread Kay Schluehr
Guido van Rossum schrieb: >I suppose the PEP 3002 proposal was written with the assumption that a >*syntactic* conversion would be doable purely mechanically, and that >the semantic issues would be sorted out using a second phase tool. > I have a question towards the syntax/semantics distinction