Re: [Python-Dev] Proposal to eliminate PySet_Fini

2006-07-02 Thread Martin v. Löwis
Jack Diederich wrote: > PyObject_MALLOC does a good job of reusing small allocations but it > can't quite manage the same speed as a free list, especially for things that > have some extra setup involved (tuples have a free list for each length). I would question that statement, for any practical

Re: [Python-Dev] Lexical scoping in Python 3k

2006-07-02 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > > On 7/3/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > Greg Ewing <[EMAIL PROTECTED]> wrote: > > > Josiah Carlson wrote: > > > > If the only code that benefits from such changes are "very *simple*", > > > > then I think that says something a

Re: [Python-Dev] Lexical scoping in Python 3k

2006-07-02 Thread Guido van Rossum
On 7/3/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Greg Ewing <[EMAIL PROTECTED]> wrote: > > Josiah Carlson wrote: > > > If the only code that benefits from such changes are "very *simple*", > > > then I think that says something about its necessity. > > > > The point is that they're only "ve

Re: [Python-Dev] Lexical scoping in Python 3k

2006-07-02 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > If the only code that benefits from such changes are "very *simple*", > > then I think that says something about its necessity. > > The point is that they're only "very simple" if you > can write them using access to an outer scope

[Python-Dev] DRAFT: python-dev summary for 2006-06-01 to 2006-06-15

2006-07-02 Thread Steven Bethard
Here's the summary for the first half of June. Thanks in advance for your comments and corrections! = Announcements = --- Python 2.5 schedule --- Python 2.5 is moving steadily towards its next release. See `PEP 356`_ for more details and

[Python-Dev] bug #1513646

2006-07-02 Thread Yi Ding
Hi guys, I filed this bug but sourceforge is down so I can't update it: http://sourceforge.net/tracker/index.php?func=detail&aid=1513646&group_id=5470&atid=105470 Basically, os.access returns the wrong result for W_OK, and that's because instead of using & it uses && to see if the file is read on

Re: [Python-Dev] Proposal to eliminate PySet_Fini

2006-07-02 Thread Jack Diederich
On Tue, Jun 27, 2006 at 02:09:19PM -0400, Alexander Belopolsky wrote: > Setobject code allocates several internal objects on the heap that are > cleaned up by the PySet_Fini function. This is a fine design choice, > but it often makes debugging applications with embedded python more > difficult. >

Re: [Python-Dev] 2.5 and beyond

2006-07-02 Thread Greg Ewing
Tim Peters wrote: > Scheme has no loops in Python's sense -- > things like "do" are shorthand for expressing stylized recursion But it does have foreach and map, which are the moral equivalent of Python's for-loops and list comprehensions. The body is a lambda which takes the loop variable as a p

Re: [Python-Dev] 2.5 and beyond

2006-07-02 Thread Greg Ewing
Giovanni Bajo wrote: > I believe that names in > lambdas/nested-functions referring to local names in the outer scope should > really be bound at function definition time No, you don't want that, because it would make functions that call each other very awkward to arrange. > And it's also handy t

Re: [Python-Dev] Lexical scoping in Python 3k

2006-07-02 Thread Greg Ewing
Josiah Carlson wrote: > If the only code that benefits from such changes are "very *simple*", > then I think that says something about its necessity. The point is that they're only "very simple" if you can write them using access to an outer scope. Without that ability, they become less simple, l

Re: [Python-Dev] Lexical scoping in Python 3k

2006-07-02 Thread Ka-Ping Yee
On Sat, 1 Jul 2006, Andrew Koenig wrote: > I'd rather see a simpler rule: = never defines a variable in a surrounding > scope. If you want to affect the binding of such a variable, you have to > define it explicitly in the scope in which you want it. > > Example: > > x = 42 > def f():

[Python-Dev] Another 2.5 bug candidate?

2006-07-02 Thread Nick Maclaren
"A.M. Kuchling" <[EMAIL PROTECTED]> wrote: > > http://www.python.org/sf/1488934 argues that Python's use of fwrite() > has incorrect error checking; this most affects file.write(), but > there are other uses of fwrite() in the core. It seems fwrite() can > return N bytes written even if an error

[Python-Dev] Another 2.5 bug candidate?

2006-07-02 Thread A.M. Kuchling
http://www.python.org/sf/1488934 argues that Python's use of fwrite() has incorrect error checking; this most affects file.write(), but there are other uses of fwrite() in the core. It seems fwrite() can return N bytes written even if an error occurred, and the code needs to also check ferror(f->f

Re: [Python-Dev] 2.5 and beyond

2006-07-02 Thread Phillip J. Eby
At 01:58 PM 7/2/2006 +0200, [EMAIL PROTECTED] wrote: >I believe the problem has nothing to do with how many scopes a block/function >definition has, but with what the lambda does with the scope it's given. >Currently it remembers the block and looks up the nescessary variables in it >when it's invo

[Python-Dev] 2.5 and beyond

2006-07-02 Thread jan-python
Hi everyone, Even though I'm new on this list I think I've got something sensible to say on this one. (I've been following this list a bit through the archives) Andrew Koenig wrote: > You seem to be right -- the problem is not that Python is lexically scoped, > but that when you define a variabl

Re: [Python-Dev] LOAD_CONST POP_TOP

2006-07-02 Thread Armin Rigo
Hi Georg, On Fri, Jun 30, 2006 at 08:39:13PM +0200, Georg Brandl wrote: > + case LOAD_CONST: > + cumlc = lastlc + 1; > + /* Skip over LOAD_CONST POP_TOP */ > + if (codestr[i+3] == POP_TO