Re: [Python-3000] More wishful thinking

2006-04-16 Thread Guido van Rossum
On 4/15/06, Talin <[EMAIL PROTECTED]> wrote: > Another grab-bag of language ideas / wishes. In the future, please use one idea/wish per email and use a subject line indicative of the subject (so *don't* use "Another wish" :-) -- --Guido van Rossum (home page: http://www.python.org/~guido/) __

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Guido van Rossum
On 4/16/06, Aahz <[EMAIL PROTECTED]> wrote: > On Sun, Apr 16, 2006, Greg Ewing wrote: > > Jim Jewett wrote: > >> > >> (I wouldn't want to give up slicing, though, which might make the > >> no-iteration trickier.) > > > > You'd want to allow slicing but not indexing -- i.e. > > s[i:j] is okay but no

Re: [Python-3000] More wishful thinking

2006-04-16 Thread skip
>> Because then the re module wouldn't be thread safe. talin> True, although I suppose that you could add a "last match" to talin> regular expression objects: talin> re_pattern = re.compile( ... ) talin> if re_pattern.match( string ): talin>text = re_pattern.lastmatc

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Guido van Rossum
On 4/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I think you may be right. I implemented this (it was really simple to > do) but then found I had to fix tons of places that iterate over > strings. I'm abandoning this project; the patch is SF patch 1471291. I'm no longer in favor of this i

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Josiah Carlson
Talin <[EMAIL PROTECTED]> wrote: > > Talin acm.org> writes: > > > 2) A suggestion which I've seen others bring up before is the use of > > the * operator for tuple packing / unpacking operations, i.e.: > > > > a, *b = (1, 2, 3) > > I wanted to add another case that I run across in my code

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Giovanni> I'm sure you were talking more generically, but as for > this Giovanni> specific case (which is indeed very common), I > always wondered Giovanni> why re couldn't export wrappers around > bound methods of the Giovanni> last match object, so to a

Re: [Python-3000] More wishful thinking

2006-04-16 Thread skip
Giovanni> Can't you put the global last-match object into TLS? What if you're not using threads? Skip ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailm

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Giovanni Bajo
[EMAIL PROTECTED] wrote: > Giovanni> Can't you put the global last-match object into TLS? > > What if you're not using threads? Hey, that was *my* point. For all the Python programs which don't use multi-threading, having a global match object is a very important shortcut. It allows two main

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Guido van Rossum
On 4/16/06, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > For all the Python programs which don't use multi-threading, having a global > match object is a very important shortcut. It allows two main things: having > multiple if/elif regexp chains which do not add an indent level each time, and > have

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Guido van Rossum
On 4/15/06, Talin <[EMAIL PROTECTED]> wrote: > Another grab-bag of language ideas / wishes. Some of these are > items that have been raised before on other lists - I want to get them > written down so that they can be rejected quickly :) > > 1) I don't know if this is already on the table, but I su

Re: [Python-3000] symbols?

2006-04-16 Thread Guido van Rossum
On 4/14/06, Kendall Clark <[EMAIL PROTECTED]> wrote: > Fair enough. My primary use case is using Python as a host for a > Domain Specific Language. [...] Then I suggest that having a good syntax is important; you don't want your DSL to look ugly because that would not contribute to having fun. Le

Re: [Python-3000] Removing 'self' from method definitions

2006-04-16 Thread Guido van Rossum
On 4/16/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Ian Bicking wrote: > > > Class.some_method(self, blah) seems like a corner case. How often do > > you do that? > > Very frequently, when calling inherited __init__ methods. > > > If it is calling a superclass method, then super(Class, > > self).s

Re: [Python-3000] Allowing underscores in numeric constants.

2006-04-16 Thread Guido van Rossum
On 4/15/06, Ian D. Bollinger <[EMAIL PROTECTED]> wrote: > Personally I like the idea (stolen from Perl, and others) of allowing > underscores in numbers as to group digits, for instance: > one_million = 1_000_000 > maximum = 0xFF_FF_FF_FF > > Once four or more identical digits appear in a row, I fi

Re: [Python-3000] AST access (WAS: Adaptation vs. Generic Functions)

2006-04-16 Thread Guido van Rossum
If someone really wants AST access in Python 3000, they should design and implement an API and propose it. I see it as a borderline feature from the POV of my own agenda for Python 3000, but not as something I'd likely reject if it were to be offered on a silver platter; especially if there was a c

[Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Guido van Rossum
Some of the coding projects I've recently been proposing as challenges to certain wild feature proposals might make good topics for the Google Summer of Code (see http://code.google.com/soc/ ). We'd need someone to volunteer as a mentor, and a student to do the work over the summer; the student wo

Re: [Python-3000] symbols?

2006-04-16 Thread Kendall Clark
On Apr 16, 2006, at 4:06 PM, Guido van Rossum wrote: > On 4/14/06, Kendall Clark <[EMAIL PROTECTED]> wrote: >> Fair enough. My primary use case is using Python as a host for a >> Domain Specific Language. [...] > > Then I suggest that having a good syntax is important; you don't want > your DSL t

Re: [Python-3000] symbols?

2006-04-16 Thread Guido van Rossum
On 4/16/06, Kendall Clark <[EMAIL PROTECTED]> wrote: > A perfectly reasonable suggestion. I like this better than writing a > PEP. Alas, that doesn't mean I have time to do it, which sucks. I > guess I shouldn't have proposed a feature for Py3K w/out the time to > back it up with code. Perhaps you

Re: [Python-3000] Is reload() feasible?

2006-04-16 Thread Guido van Rossum
I'm not against a better reload() if a reasonable set of heuristics can be defined (e.g. many people have asked for class objects to be *edited* instead of replaced; and of course there's the dependencies graph problem). I'm even OK with changing the definition of the language (slightly) to make e.

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Thomas Wouters
On 4/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: On 4/15/06, Talin <[EMAIL PROTECTED]> wrote:> Another grab-bag of language ideas / wishes. Some of these are> items that have been raised before on other lists - I want to get them > written down so that they can be rejected quickly :)>> 1) I

Re: [Python-3000] More wishful thinking

2006-04-16 Thread skip
Giovanni> Can't you put the global last-match object into TLS? >> What if you're not using threads? Giovanni> Hey, that was *my* point. Giovanni> For all the Python programs which don't use multi-threading, Giovanni> having a global match object is a very important shortcut.

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Talin
Guido van Rossum python.org> writes: > On 4/15/06, Talin acm.org> wrote: > > Another grab-bag of language ideas / wishes. Some of these are > > items that have been raised before on other lists - I want to get them > > written down so that they can be rejected quickly :) > > > > 1) I don't know

[Python-3000] Test and Assign [was: More wishful thinking]

2006-04-16 Thread Talin
pobox.com> writes: > This really isn't Python 3000 material, folks. I thought my first response > would trigger an "Oh yeah, I hadn't thought of that", not continual > ill-conceived "yeah, but you can do this instead when the situation is > right". Please take it c.l.py, hash it out there, and

Re: [Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Neal Norwitz
On 4/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Some of the coding projects I've recently been proposing as challenges > to certain wild feature proposals might make good topics for the > Google Summer of Code (see http://code.google.com/soc/ ). > > (I can't volunteer to be a mentor mysel

Re: [Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Brett Cannon
On 4/16/06, Neal Norwitz <[EMAIL PROTECTED]> wrote: > On 4/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Some of the coding projects I've recently been proposing as challenges > > to certain wild feature proposals might make good topics for the > > Google Summer of Code (see http://code.go

Re: [Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Neal Norwitz
On 4/16/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > > again, if my host at Google wants me to spend my working hours being a > good mentor I could possibly be convinced to make sure I get assigned > one student (two turned out to be too much). =) I heard your host is a slave driver and an assho

Re: [Python-3000] More wishful thinking

2006-04-16 Thread Terry Reedy
"Talin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Unfortunately, if the paragraph only contains a single word, > this blows up. So what you end up having to do is: > > parts = paragraph.split( ' ', 1 ) > if len( parts ) > 1: > first, rest = parts > else: > firs

Re: [Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Brett Cannon
On 4/16/06, Neal Norwitz <[EMAIL PROTECTED]> wrote: > On 4/16/06, Brett Cannon <[EMAIL PROTECTED]> wrote: > > > > again, if my host at Google wants me to spend my working hours being a > > good mentor I could possibly be convinced to make sure I get assigned > > one student (two turned out to be to

Re: [Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Jay Parlar
On Apr 16, 2006, at 2:34 PM, Guido van Rossum wrote: > Some of the coding projects I've recently been proposing as challenges > to certain wild feature proposals might make good topics for the > Google Summer of Code (see http://code.google.com/soc/ ). > > We'd need someone to volunteer as a ment

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Greg Ewing
Guido van Rossum wrote: > (I'm surprised by this. Why would s[i] be wrong?) Because if we're to be consistent about the notion that a string isn't a sequence of characters, s[i] is really a slice of length one, and should be expressed that way. Also, if len(s) and s[i] are both legal, it becomes

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Aahz
On Mon, Apr 17, 2006, Greg Ewing wrote: > Guido van Rossum wrote: >> >> I think you may be right. I implemented this (it was really simple >> to do) but then found I had to fix tons of places that iterate over >> strings. > > I wonder if the stdlib might be a bit unusual here, since it's the > pla

Re: [Python-3000] Removing 'self' from method definitions

2006-04-16 Thread Greg Ewing
Guido van Rossum wrote: > On 4/16/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > > In the case of __init__ > > methods, most of the time it simply doesn't work, > > because different __init__ methods rarely have the > > same signature. > > How does that prevent you from using super()? (Hint: it does

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Michael P. Soulier
On 16/04/06 Aahz said: > Anything that would make this solution more difficult to explain would > make my life more difficult. I know there are many better and more > efficient mechanisms (particularly if one is not restricted to Python > 2.2), but it seems to me that we cannot afford to let Pyt

Re: [Python-3000] Removing 'self' from method definitions

2006-04-16 Thread Michael P. Soulier
On 17/04/06 Greg Ewing said: > The other possible reason for using super() is so > you don't have to write the name of the base class > into all your inherited method calls. But that's a > separate issue that would be better addressed by a > different mechanism, rather than conflating the > two in

Re: [Python-3000] auto-super()

2006-04-16 Thread Aahz
On Sun, Apr 16, 2006, Michael P. Soulier wrote: > On 17/04/06 Greg Ewing said: >> >> The other possible reason for using super() is so you don't have >> to write the name of the base class into all your inherited method >> calls. But that's a separate issue that would be better addressed by >> a d

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Tim Peters
[Guido] >> ... >> I implemented this (it was really simple to do) but then found I had >> to fix tons of places that iterate over strings. [Greg Ewing] > I wonder if the stdlib might be a bit unusual here, > since it's the place where low-level things are > implemented. I don't think there would b

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Aahz
On Sun, Apr 16, 2006, Tim Peters wrote: > > Now that I think of it, though, I've been burned perhaps twice in my > total Python life by recursing on a string when I didn't intend to. > Apart from flatten()-ish functions, I'm not sure I've written anything > vulnerable to that. I've been burned a

[Python-3000] Cleaning up argument list parsing (was Re: More wishful thinking)

2006-04-16 Thread Nick Coghlan
Talin wrote: > Guido van Rossum python.org> writes: > >> On 4/15/06, Talin acm.org> wrote: >>> Another grab-bag of language ideas / wishes. Some of these are >>> items that have been raised before on other lists - I want to get them >>> written down so that they can be rejected quickly :) >>> >>

Re: [Python-3000] Making strings non-iterable

2006-04-16 Thread Ian Bicking
Aahz wrote: > On Sun, Apr 16, 2006, Tim Peters wrote: >> Now that I think of it, though, I've been burned perhaps twice in my >> total Python life by recursing on a string when I didn't intend to. >> Apart from flatten()-ish functions, I'm not sure I've written anything >> vulnerable to that. > >

Re: [Python-3000] Cleaning up argument list parsing (was Re: More wishful thinking)

2006-04-16 Thread Guido van Rossum
> >> On 4/15/06, Talin acm.org> wrote: > >>> 1) I don't know if this is already on the table, but I sure would like > >>> to be able to have more options as far as mixing positional and > >>> keyword arguments. > > Guido van Rossum python.org> writes: > >> I agree. Please produce a patch that im

Re: [Python-3000] Python 3000 and the Google Summer of Code

2006-04-16 Thread Guido van Rossum
On 4/17/06, Neal Norwitz <[EMAIL PROTECTED]> wrote: > A, I was planning to rope you in as mentor. :-) I plan to mentor, > I'm not sure how many projects I can handle though. Don't plan on any for yourself; you're too busy already with the 2.5 release and with managing the mentors. > I hope a

Re: [Python-3000] Test and Assign [was: More wishful thinking]

2006-04-16 Thread Guido van Rossum
On 4/16/06, Talin <[EMAIL PROTECTED]> wrote: > I'm really more interested in the general case where you have a test, and > then you have the results of the test. It would be nice to put the conditional > statement first, and then once you know that the test succeeded, start to > look at the specifi

Re: [Python-3000] Cleaning up argument list parsing (was Re: More wishful thinking)

2006-04-16 Thread Talin
Nick Coghlan gmail.com> writes: > A question for Guido: Is this flexibility for argument passing only, or does > it apply to parameter declarations as well? Actually, parameter declarations are what I am talking about. Now go back and re-read the whole message with that in mind. :) (Its probab