Re: [Python-3000] range() issues

2008-04-29 Thread Adam Olsen
On Tue, Apr 29, 2008 at 8:36 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Let's also fix __len__() so that it returns sys.{maxint,maxsize} when > the result doesn't fit in a Py_ssize_t. Why not leave sq_length as is, but have len() bypass it and call .__len__() directly? C code is likely a

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Adam Olsen
On Tue, Apr 29, 2008 at 3:08 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 8:05 AM, Alex Martelli <[EMAIL PROTECTED]> wrote: > [SNIP - Alex's well-argued reasons to keep sched] > > > > And then, if needed, we can discuss pure simulation (as opposed to > > simulation-tes

Re: [Python-3000] Displaying strings containing unicode escapes

2008-04-29 Thread Stephen J. Turnbull
Jim Jewett writes: > I think "standard repertoire based on Unicode" may be confusing the issue. By "standard repertoire" I mean that all Pythons will show the same characters the same way, while "based on Unicode" is intended to mean looking at TR#36 and TR#39 in picking the repertoires. > As I

Re: [Python-3000] Removal of os.path.walk

2008-04-29 Thread Guido van Rossum
On Tue, Apr 29, 2008 at 8:10 PM, Tim Heaney <[EMAIL PROTECTED]> wrote: > Speaking of this, is it too late to lobby for an iterator version of > os.listdir? (Perhaps listdir would not be the best name. :) > > There is one at > > http://wxidle.sourceforge.net/projects/xlistdir/ > > but I think i

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Tue, Apr 29, 2008 at 10:36 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: .. > There are good reasons for having range() return an Iterable and not > an Iterator; What would you say to an idea of exposing rangeiter in itertools - say itertools.irange(..) function that returns an iterator? __

[Python-3000] Removal of os.path.walk

2008-04-29 Thread Tim Heaney
Speaking of this, is it too late to lobby for an iterator version of os.listdir? (Perhaps listdir would not be the best name. :) There is one at http://wxidle.sourceforge.net/projects/xlistdir/ but I think it ought to be in the standard library. Moreover, if we had such a thing, shouldn't os.w

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
Correction: My calculation below was only correct for N = 1 case. In general, the two alternatives will create N+2 vs. N+1 auxiliary objects. On Tue, Apr 29, 2008 at 10:53 PM, Alexander Belopolsky <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 10:36 PM, Guido van Rossum <[EMAIL PROTECTED]>

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Tue, Apr 29, 2008 at 5:18 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: .. > > Put another way: range(n) currently works, in Py3k, for n > sys.maxsize. > > What's the rationale for breaking that? > > So we can support other sequence methods. (I think.) > This is not true. The missing sequ

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Tue, Apr 29, 2008 at 10:36 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: .. > There are good reasons for having range() return an Iterable and not > an Iterator; e.g. > > R = range(N) > for i in R: > for j in R: > You realize that in the snippet above whatever cycles you save b

Re: [Python-3000] range() issues

2008-04-29 Thread Guido van Rossum
I propose to remove the support for indexing; it is a carryover from before Python 2.2 when there was no .next() method. There are good reasons for having range() return an Iterable and not an Iterator; e.g. R = range(N) for i in R: for j in R: so here I propose to keep the status quo

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Tue, Apr 29, 2008 at 7:48 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: .. > Let's just stop the discussion here and kill all proposals to add > indexing/slicing etc. Sorry, Alexander, but there just isn't anyone > besides you in favor, and nobody has brought up a convincing use case. > Th

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 3:03 PM, David Bolen <[EMAIL PROTECTED]> wrote: > "Brett Cannon" <[EMAIL PROTECTED]> writes: > > > Also realize all of the right people have been consulted on this stuff > > (e.g., the web SIG about the urllib package). So please do not think > > that something that seems

Re: [Python-3000] range() issues

2008-04-29 Thread Guido van Rossum
On Tue, Apr 29, 2008 at 2:18 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 4:09 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > Put another way: range(n) currently works, in Py3k, for n > sys.maxsize. > > What's the rationale for breaking that? > > So we can suppo

Re: [Python-3000] Removal of os.path.walk

2008-04-29 Thread Facundo Batista
2008/4/28, Benjamin Peterson <[EMAIL PROTECTED]>: > It seems that os.walk has more options and a cleaner interface to > walking trees than os.path.walk does. Is there support for the removal > this in Py3k? +1 -- .Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.o

Re: [Python-3000] range() issues

2008-04-29 Thread Facundo Batista
2008/4/29, Benjamin Peterson <[EMAIL PROTECTED]>: > On Tue, Apr 29, 2008 at 4:09 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > > Put another way: range(n) currently works, in Py3k, for n > sys.maxsize. > > What's the rationale for breaking that? > > So we can support other sequence methods. (

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Alex Martelli
On Tue, Apr 29, 2008 at 2:08 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 8:05 AM, Alex Martelli <[EMAIL PROTECTED]> wrote: > [SNIP - Alex's well-argued reasons to keep sched] > > > > And then, if needed, we can discuss pure simulation (as opposed to > > simulation-tes

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Benjamin Peterson
On Tue, Apr 29, 2008 at 5:03 PM, David Bolen <[EMAIL PROTECTED]> wrote: > > I have an application using the QuickTime portion of the Carbon package > very successfully in recent code (with a primarily Tiger-based user > base), where the higher level Cocoa/ObjC frameworks didn't provide the > ne

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread David Bolen
"Brett Cannon" <[EMAIL PROTECTED]> writes: > Also realize all of the right people have been consulted on this stuff > (e.g., the web SIG about the urllib package). So please do not think > that something that seems drastic (e.g., the removal of all > Mac-specific modules) was taken lightly when in

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 2:32 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 4:26 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > Well, I have been planning implementing that exact function at some > > point as part of my "let's get Python's testing tool support up to

Re: [Python-3000] range() issues

2008-04-29 Thread Terry Reedy
"Alexander Belopolsky" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Mon, Apr 28, 2008 at 7:18 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: | .. | > The cost of the extra functionality: writing it, reviewing it, adding | > unittests, documenting it, maintaining it, making

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Benjamin Peterson
On Tue, Apr 29, 2008 at 4:26 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > Well, I have been planning implementing that exact function at some > point as part of my "let's get Python's testing tool support up to > snuff" project (which, of course, will happen between now and when I > fall over

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 2:08 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > On Mon, Apr 28, 2008 at 9:30 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > #. Remove the module. > > #. Remove the tests. > > #. Edit ``Modules/Setup.dist`` and ``setup.py`` if needed. > > #. Remove the docs (

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Mike Klaas
On 29-Apr-08, at 2:08 PM, Brett Cannon wrote: On Tue, Apr 29, 2008 at 8:05 AM, Alex Martelli <[EMAIL PROTECTED]> wrote: [SNIP - Alex's well-argued reasons to keep sched] And then, if needed, we can discuss pure simulation (as opposed to simulation-testing of systems designed to normally use

Re: [Python-3000] range() issues

2008-04-29 Thread Benjamin Peterson
On Tue, Apr 29, 2008 at 4:09 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote: > Put another way: range(n) currently works, in Py3k, for n > sys.maxsize. > What's the rationale for breaking that? So we can support other sequence methods. (I think.) Personally, I think that range should be just an ea

Re: [Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 1:57 PM, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 4/29/08, Brett Cannon <[EMAIL PROTECTED]> wrote: [SNIP] > > > > I'd like to see the PEP address the question of how it is going to deal > > > with getting duplicate copies of modules in sys.modules when some code > in

Re: [Python-3000] range() issues

2008-04-29 Thread Mark Dickinson
On Tue, Apr 29, 2008 at 4:30 PM, Alexander Belopolsky < [EMAIL PROTECTED]> wrote: > I would say that if it is possible that n exceeds a few hundred > million, it is a good idea to pause and think whether you want to have > this loop implemented in Python to begin with. > Maybe. But the answer is

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 8:05 AM, Alex Martelli <[EMAIL PROTECTED]> wrote: [SNIP - Alex's well-argued reasons to keep sched] > And then, if needed, we can discuss pure simulation (as opposed to > simulation-testing of systems designed to normally use the "real" > sched). But already it seems to

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Benjamin Peterson
On Mon, Apr 28, 2008 at 9:30 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > #. Remove the module. > #. Remove the tests. > #. Edit ``Modules/Setup.dist`` and ``setup.py`` if needed. > #. Remove the docs (if applicable). > #. Run the regression test suite (using ``-uall``); watch out for >te

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 7:39 AM, Quentin Gallet-Gilles <[EMAIL PROTECTED]> wrote: > > > > On Tue, Apr 29, 2008 at 5:43 PM, <[EMAIL PROTECTED]> wrote: > > Hi list, > > > > I'm a long time lurker with only a very few contributions > > in Tkinter. Just one remark about the inclusion of Canvas > > in t

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Georg Brandl
Brett Cannon schrieb: [bcc to stdlib-sig] After two false starts over the YEARS of trying to cleanup and reorganize the stdlib, creating a SIG to get this going, having Guido give the PEP the once-over over the past several days, and creating two new bugs reports (issues 2715 and 2716), PEP 3108

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 8:43 AM, <[EMAIL PROTECTED]> wrote: > Hi list, > > I'm a long time lurker with only a very few contributions > in Tkinter. Just one remark about the inclusion of Canvas > in the tkinter package: > Canvas is marked as obsolete since 2000. > See this issue (and the comme

Re: [Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Jim Jewett
On 4/29/08, Brett Cannon <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 5:07 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > Raymond Hettinger wrote: > > > > For modules that are renamed, stub modules will be created with the > > > > original names ... > > > What is the purpose of the ne

Re: [Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 5:07 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Raymond Hettinger wrote: > > > > > > * UserList/UserString [done: 3.0] > > > > > > > Note that these were updated and moved to the collections module in Py3.0. > > > > > > > anydbm dbm.tools [1]_ > > > whichdb

Re: [Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Tue, Apr 29, 2008 at 2:46 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > > * UserList/UserString [done: 3.0] > > > > Note that these were updated and moved to the collections module in Py3.0. > Noted. > > > > anydbm dbm.tools [1]_ > > whichdbdbm.tools [1]_ > > >

Re: [Python-3000] Removal of os.path.walk

2008-04-29 Thread Guido van Rossum
+1 On 4/28/08, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > It seems that os.walk has more options and a cleaner interface to > walking trees than os.path.walk does. Is there support for the removal > this in Py3k? > > -- > Cheers, > Benjamin Peterson > __

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Brett Cannon
On Mon, Apr 28, 2008 at 11:11 PM, Adam Olsen <[EMAIL PROTECTED]> wrote: > On Mon, Apr 28, 2008 at 8:30 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > * sched > > > > + Replaced by threading.Timer. > > I don't see sched as obsoleted by threading.Timer. It's much simpler > to use (no need f

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Tue, Apr 29, 2008 at 4:17 PM, Mark Dickinson <[EMAIL PROTECTED]> wrote: .. > I'd like to be able to write > > for i in range(n): > ... > > without having to stop and worry about whether n is always going > to be small enough to avoid an exception, and what to do if there's > a possibility t

Re: [Python-3000] range() issues

2008-04-29 Thread Mark Dickinson
On Tue, Apr 29, 2008 at 10:30 AM, Alexander Belopolsky < [EMAIL PROTECTED]> wrote: > or sizable. I would say "range(n) is a memory efficient substitute > for [0, 1, ... n-1]" is easier to fit into one's brain that the > current hodgepodge of exceptions. > For what it's worth, I'm -1 on any chan

Re: [Python-3000] Displaying strings containing unicode escapes

2008-04-29 Thread Jim Jewett
On 4/29/08, Stephen J. Turnbull <[EMAIL PROTECTED]> wrote: > atsuo ishimoto writes: > > > 2008/4/17 Stephen J. Turnbull <[EMAIL PROTECTED]>: > > > How about choosing a standard Python repertoire (based on the Unicode > > > standard, of course) of which characters get a graphic repr and whic

Re: [Python-3000] Displaying strings containing unicode escapes

2008-04-29 Thread Stephen J. Turnbull
atsuo ishimoto writes: > 2008/4/17 Stephen J. Turnbull <[EMAIL PROTECTED]>: > > How about choosing a standard Python repertoire (based on the Unicode > > standard, of course) of which characters get a graphic repr and which > > ones get \u-escaped, and have a post-hook for repr which gets p

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Jim Baker
+1 to keep. Simple, reliable, and used. On Tue, Apr 29, 2008 at 11:58 AM, Paul Moore <[EMAIL PROTECTED]> wrote: > On 29/04/2008, Alex Martelli <[EMAIL PROTECTED]> wrote: > > On Tue, Apr 29, 2008 at 5:10 AM, Nick Coghlan <[EMAIL PROTECTED]> > wrote: > > ... > > > Perhaps sched/mutex could be du

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Adam Olsen
On Tue, Apr 29, 2008 at 9:05 AM, Alex Martelli <[EMAIL PROTECTED]> wrote: [snippage] > And then, if needed, we can discuss pure simulation (as opposed to > simulation-testing of systems designed to normally use the "real" > sched). But already it seems to me there are plenty of use cases to > j

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Paul Moore
On 29/04/2008, Alex Martelli <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 5:10 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > ... > > Perhaps sched/mutex could be dumped in the Demo directory? Or perhaps we > > should just get rid of them entirely and see if anyone with a real use case >

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Alex Martelli
On Tue, Apr 29, 2008 at 5:10 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: ... > Perhaps sched/mutex could be dumped in the Demo directory? Or perhaps we > should just get rid of them entirely and see if anyone with a real use case > complains - it's not like the modules will be particularly hard

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Quentin Gallet-Gilles
On Tue, Apr 29, 2008 at 5:43 PM, <[EMAIL PROTECTED]> wrote: > Hi list, > > I'm a long time lurker with only a very few contributions > in Tkinter. Just one remark about the inclusion of Canvas > in the tkinter package: > Canvas is marked as obsolete since 2000. > See this issue (and the comment at

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Mon, Apr 28, 2008 at 7:18 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: .. > The cost of the extra functionality: writing it, reviewing it, adding > unittests, documenting it, maintaining it, making sure it works on > 64-bit machines, having Python book authors discuss it; and in > additio

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Alex Martelli
On Tue, Apr 29, 2008 at 5:01 AM, Thomas Wouters <[EMAIL PROTECTED]> wrote: ... > > > * sched > > > > > > + Replaced by threading.Timer. > > > > I don't see sched as obsoleted by threading.Timer. It's much simpler > > to use (no need for locking) and more efficient (no legions of > > sleeping

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread mkieverpy
Hi list, I'm a long time lurker with only a very few contributions in Tkinter. Just one remark about the inclusion of Canvas in the tkinter package: Canvas is marked as obsolete since 2000. See this issue (and the comment at the top of Canvas.py): http://bugs.python.org/issue210677 Cheers, Matt

Re: [Python-3000] range() issues

2008-04-29 Thread Alexander Belopolsky
On Mon, Apr 28, 2008 at 7:21 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > BTW, if you're looking for a term describing range() that's better > than set or sequence, how about "series"? It's a mathematical word > that matches pretty exactly. No, mathematical series is the sum of a sequence:

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Alex Martelli
Hi Brett, great job -- but I would like to plead for the life of the sched module. I love sched and use it often for purposes for which it seems to me that the proposed replacement strategy (via threading.Timer) is not suitable: for example when I'm on a platform without threads (and don't need

Re: [Python-3000] Displaying strings containing unicode escapes

2008-04-29 Thread atsuo ishimoto
2008/4/17 Stephen J. Turnbull <[EMAIL PROTECTED]>: > How about choosing a standard Python repertoire (based on the Unicode > standard, of course) of which characters get a graphic repr and which > ones get \u-escaped, and have a post-hook for repr which gets passed > the string repr proposes to

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Nick Coghlan
Thomas Wouters wrote: On Tue, Apr 29, 2008 at 8:11 AM, Adam Olsen <[EMAIL PROTECTED] > wrote: On Mon, Apr 28, 2008 at 8:30 PM, Brett Cannon <[EMAIL PROTECTED] > wrote: > * sched > > + Replaced by threading.Timer.

Re: [Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Nick Coghlan
Raymond Hettinger wrote: * UserList/UserString [done: 3.0] Note that these were updated and moved to the collections module in Py3.0. anydbm dbm.tools [1]_ whichdbdbm.tools [1]_ Were there any better naming suggestions than dbm.tools? The original names seem muc

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Thomas Wouters
On Tue, Apr 29, 2008 at 8:11 AM, Adam Olsen <[EMAIL PROTECTED]> wrote: > On Mon, Apr 28, 2008 at 8:30 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: > > * sched > > > > + Replaced by threading.Timer. > > I don't see sched as obsoleted by threading.Timer. It's much simpler > to use (no need for lo

Re: [Python-3000] [stdlib-sig] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Raymond Hettinger
* UserList/UserString [done: 3.0] Note that these were updated and moved to the collections module in Py3.0. anydbm dbm.tools [1]_ whichdbdbm.tools [1]_ Were there any better naming suggestions than dbm.tools? The original names seem much more informative.

Re: [Python-3000] PEP 3108 - stdlib reorg/cleanup

2008-04-29 Thread Ronald Oussoren
On 29 Apr, 2008, at 5:39, Bill Janssen wrote: Nice job, Brett. I only have two concerns: As you don't quite note, the Mac "ic" module is the interface to the "Internet Configuration" system on the Mac. In particular, it's where proxy information is drawn from. We need to have that replaceme