Re: [Python-Dev] Musings on concurrency and scoping ("replacing" Javascript)

2006-07-09 Thread Michael Hudson
Ka-Ping Yee <[EMAIL PROTECTED]> writes: > Client-side web scripting tends to have a callback/continuation-ish > concurrency style because it has to deal with network transactions > (which can stall for long periods of time) in a user interface that > is expected to stay always responsive. The Fir

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-09 Thread Tim Peters
[Anthony Baxter] > Hm. Would it be a smaller change to expose head_mutex so that the > external module could use it? No, in part because `head_mutex` may not exist (depends on the build type). What an external module would actually need is 3 new public C API functions, callable workalikes for pys

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-09 Thread Andrew Koenig
> So, if I understand correctly, in the presence of a global statement > search > just goes up the lexical chain looking for the first occurrence of the > variable to modify? > > x = 0 > def f(): > x = 1 > def g(): > global x > x = 2 > pr

Re: [Python-Dev] In defense of Capabilities [was: doc for new restricted execution design for Python]

2006-07-09 Thread Brett Cannon
On 7/8/06, Talin <[EMAIL PROTECTED]> wrote: Brett Cannon wrote:> On 7/7/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:>> On 7/8/06, Ka-Ping Yee <[EMAIL PROTECTED] > wrote:>> > I'd like the answer to be yes.  It sounded for a while like this>> > was not part of Brett's plan, though.  Now i'm not so

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-09 Thread Ka-Ping Yee
On Sun, 9 Jul 2006, Andrew Koenig wrote: > > Sounds reasonable to me. If we're talking py3k I'd chuck "global" as a > > keyword though and replace it with something like "outer". > > I must say that I don't like "outer" any more than I like "global." The > problem is that in both cases we are sel

[Python-Dev] Weekly Python Patch/Bug Summary

2006-07-09 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 393 open (+15) / 3315 closed (+17) / 3708 total (+32) Bugs: 908 open (+22) / 5975 closed (+49) / 6883 total (+71) RFE : 223 open ( -1) / 229 closed ( +2) / 452 total ( +1) New / Reopened Patches __ test_grp.

[Python-Dev] Unary minus bug

2006-07-09 Thread Neil Schemenauer
The bug was reported by Armin in SF #1333982: the literal -2147483648 (i.e. the value of -sys.maxint-1) gives a long in 2.5, but an int in <= 2.4. I have a fix but I wonder if it's the right thing to do. I suppose returning a long has the chance of breaking someone code. Here's the test

Re: [Python-Dev] Unary minus bug

2006-07-09 Thread Guido van Rossum
I think it ought to be an int, like before. --Guido On 7/9/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote: > The bug was reported by Armin in SF #1333982: > > the literal -2147483648 (i.e. the value of -sys.maxint-1) gives > a long in 2.5, but an int in <= 2.4. > > I have a fix but I wond

Re: [Python-Dev] Unary minus bug

2006-07-09 Thread Tim Peters
[Neil Schemenauer] > The bug was reported by Armin in SF #1333982: > > the literal -2147483648 (i.e. the value of -sys.maxint-1) gives > a long in 2.5, but an int in <= 2.4. That actually depends on how far back you go. It was also a long "at the start". IIRC, Fred or I added hackery to

Re: [Python-Dev] Unary minus bug

2006-07-09 Thread Neal Norwitz
Do we care about this (after your checkin and with my fix to make 32-63 bit values ints rather than longs): # 64 bit box >>> minint = str(-sys.maxint - 1) >>> minint '-9223372036854775808' >>> eval(minint) -9223372036854775808 >>> eval('-(%s)' % minint[1:]) -9223372036854775808L n -- On 7/9/06, N

Re: [Python-Dev] Unary minus bug

2006-07-09 Thread Neil Schemenauer
On Sun, Jul 09, 2006 at 03:02:06PM -0700, Neal Norwitz wrote: > Do we care about this (after your checkin and with my fix to make > 32-63 bit values ints rather than longs): > > # 64 bit box > >>>minint = str(-sys.maxint - 1) > >>>minint > '-9223372036854775808' > >>>eval(minint) > -92233720368547

Re: [Python-Dev] Unary minus bug

2006-07-09 Thread Neal Norwitz
On 7/9/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote: > On Sun, Jul 09, 2006 at 03:02:06PM -0700, Neal Norwitz wrote: > > Do we care about this (after your checkin and with my fix to make > > 32-63 bit values ints rather than longs): > > > > # 64 bit box > > >>>minint = str(-sys.maxint - 1) > > >>

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-09 Thread Tim Peters
Just to make life harder ;-), I should note that code, docs and tests for sys._current_frames() are done, on the tim-current_frames branch. All tests pass, and there are no leaks in the new code. It's just a NEWS blurb away from being just another hectic release memory :-)

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-09 Thread Talin
Ka-Ping Yee wrote: > On Sun, 9 Jul 2006, Andrew Koenig wrote: > >>>Sounds reasonable to me. If we're talking py3k I'd chuck "global" as a >>>keyword though and replace it with something like "outer". >> >>I must say that I don't like "outer" any more than I like "global." The >>problem is that i

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-09 Thread Talin
Talin wrote: > Some alternatives: > > use x > using x > with x -- recycle a keyword? > reuse x > use extant x > share x > common x > same x > borrow x > existing x > > Although, to be perfectly honest, the longer this discussion goes on, > th

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-09 Thread Guido van Rossum
On 7/9/06, Talin <[EMAIL PROTECTED]> wrote: > Talin wrote: > > Some alternatives: > > > > use x > > using x > > with x -- recycle a keyword? > > reuse x > > use extant x > > share x > > common x > > same x > > borrow x > > existing x Of these,

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-09 Thread Neal Norwitz
On 7/9/06, Tim Peters <[EMAIL PROTECTED]> wrote: > Just to make life harder ;-), I should note that code, docs and tests > for sys._current_frames() are done, on the tim-current_frames branch. > All tests pass, and there are no leaks in the new code. It's just a > NEWS blurb away from being just a

[Python-Dev] xml issue in 2.5

2006-07-09 Thread Neal Norwitz
http://python.org/sf/1513611 xml.sax.ParseException weirdness in python 2.5b1. The following code doesn't work: from xml.sax import make_parser, SAXParseException parser = make_parser() try: parser.parse(StringIO('invalid')) except SAXParseException: print 'caught it!' Any comments? n

Re: [Python-Dev] xml issue in 2.5

2006-07-09 Thread Martin v. Löwis
Neal Norwitz wrote: > http://python.org/sf/1513611 > xml.sax.ParseException weirdness in python 2.5b1. The following code > doesn't work: > > from xml.sax import make_parser, SAXParseException > > parser = make_parser() > try: >parser.parse(StringIO('invalid')) > except SAXParseException: >

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-09 Thread Anthony Baxter
On Sunday 09 July 2006 11:31, Tim Peters wrote: > Back in: > > > http://mail.python.org/pipermail/python-dev/2005-March/051856.html > > I made a pitch for adding: > > sys._current_frames() > > to 2.5, which would return a dict mapping each thread's id to that > thread's current (Python) fra

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-09 Thread Richard Jones
On 09/07/2006, at 9:05 AM, Anthony Baxter wrote: > I'm really not keen on this seeming tide of new features that > seem to be popping up. We're only a few days away from the second and > final planned beta - it's getting _awfully_ late to be slotting in > new features. And besides, one person has

Re: [Python-Dev] "Missing" 2.5 feature

2006-07-09 Thread Georg Brandl
Richard Jones wrote: > On 09/07/2006, at 9:05 AM, Anthony Baxter wrote: >> I'm really not keen on this seeming tide of new features that >> seem to be popping up. We're only a few days away from the second and >> final planned beta - it's getting _awfully_ late to be slotting in >> new features. >