Re: [Python-Dev] Builtin exit, good in interpreter, bad in code.

2006-04-23 Thread Nick Coghlan
Sean Reifschneider wrote: > Thoughts? As Martin pointed out, this was fixed for 2.5a1: C:\>type demo.bat @c:\python%1\python -c "exit()" @echo %ERRORLEVEL% C:\>demo 24 Traceback (most recent call last): File "", line 1, in ? TypeError: 'str' object is not callable 1 C:\>demo 25 0 Cheers, Ni

Re: [Python-Dev] Proposed addition to threading module - released

2006-04-23 Thread Martin v. Löwis
Nick Coghlan wrote: > Do we want to add a "released" context manager to the threading module for > 2.5? I don't think that should be added. I would consider it a dangerous programming style: if the lock merely doesn't "need" to be held (i.e. if it isn't necessary, but won't hurt), one should jus

Re: [Python-Dev] Builtin exit, good in interpreter, bad in code.

2006-04-23 Thread Martin v. Löwis
Sean Reifschneider wrote: > Thoughts? In Python 2.5, exit(0) exits. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/arch

Re: [Python-Dev] windows buildbot failures

2006-04-23 Thread Mark Hammond
Tim: > [Martin] > > on XP SP2: test_mailbox fails to > > me, with permission denied in some (random) test. I believe this > > is due to Tortoise SVN: test_mailbox creates a few directories, > > then Tortoise detects them (thanks to file change notifications) > > and tries to walk them, to find out

[Python-Dev] Proposed addition to threading module - released

2006-04-23 Thread Nick Coghlan
Do we want to add a "released" context manager to the threading module for 2.5? It was mentioned using the name "unlocked" in PEP 343, but never spelt out: class released(object): def __init__(self, lock): self.lock = lock def __enter__(self): self.lock.release()

Re: [Python-Dev] Why are contexts also managers? (wasr45544 -peps/trunk/pep-0343.txt)

2006-04-23 Thread Nick Coghlan
Just van Rossum wrote: > Baptiste Carvello wrote: > >> Terry Reedy a écrit : >>> So I propose that the context maker be called just that: 'context >>> maker'. That should pretty clearly not be the context that manages >>> the block execution. >>> >> +1 for context maker. In fact, after reading the

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Nick Coghlan
Paul Moore wrote: >> Aside from the What's New document, this has now been done. My modifications >> consisted of terminology changes in the contextlib docs and the language >> reference to match the 2.5a1 implementation, a Context Types addition to the >> library reference similar to that for Iter

Re: [Python-Dev] Builtin exit, good in interpreter, bad in code.

2006-04-23 Thread Crutcher Dunnavant
On 4/23/06, Sean Reifschneider <[EMAIL PROTECTED]> wrote: > A friend of mine is learning Python, and had a problem with the exit > builtin. I like that in the interpreter it gives useful information, but > he was writing a program in a file and tried "exit(0)", and was presented > with the non-obv

[Python-Dev] Builtin exit, good in interpreter, bad in code.

2006-04-23 Thread Sean Reifschneider
A friend of mine is learning Python, and had a problem with the exit builtin. I like that in the interpreter it gives useful information, but he was writing a program in a file and tried "exit(0)", and was presented with the non-obvious error: TypeError: 'str' object is not callable What abou

Re: [Python-Dev] Tkinter lockups.

2006-04-23 Thread Jeff Epler
I just read the manpage for Tk_Init(3) (fc4 package tk-8.4.9-3) and it does not say that Tk_Init() may only be called once. While this doesn't mean Python shouldn't work around it, I think the behavior should be considered a bug in Tk, not _tkinter. However, on this system, I couldn't recreate th

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Paul Moore
> Aside from the What's New document, this has now been done. My modifications > consisted of terminology changes in the contextlib docs and the language > reference to match the 2.5a1 implementation, a Context Types addition to the > library reference similar to that for Iterator Types, and a very

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Martin v. Löwis
Kirat Singh wrote: > The reason I looked into this to begin with was that my code used up a > bunch of memory which was traceable to lots of little objects with > instance dicts, so it seemed that if instancedicts took less memory I > wouldn't have to go and add __slots__ to a bunch of my classes,

[Python-Dev] Tkinter lockups.

2006-04-23 Thread Thomas Wouters
For a while now, I've noticed test_tcl locking up when trying to refleaktest it. I was able to reproduce it quite simply:import Tkinterimport osif "DISPLAY" in os.environ:    del os.environ ["DISPLAY"]tcl = Tkinter.Tcl()try:    tcl.loadtk()except Exception, e:    print etcl.loadtk()Or, more directl

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Kirat Singh
Interesting, thanks for the responses. And yeah I meant 1/3, I always mix up negatives.Agree that as you point out the biggest slowdown will be on classes that define their own __hash__, however since classes use instancedicts and this would reduce the dict size from 96 -> 64 bytes, we could blow 4

[Python-Dev] Compiling w/ C++ (was: Reducing memory overhead for dictionaries by removing me_hash)

2006-04-23 Thread skip
Tim> Does the Python source even compile as C++ now? People have been Tim> working toward that, but my last impression was that it's not there Tim> yet. Yes, not there yet. I can build the base interpreter, but there are lots of module build problems. I got distracted, but will try

Re: [Python-Dev] Reducing memory overhead for dictionaries by removing me_hash

2006-04-23 Thread Tim Peters
[Kirat Singh] > Hi, this is my first python dev post, so please forgive me if this topic has > already been discussed. It's hard to find one that hasn't -- but it's even harder to find the old discussions ;-) > It seemed to me that removing me_hash from a dict entry would save 2/3 of > the space

[Python-Dev] PEP 8 pylintrc?

2006-04-23 Thread skip
I had the possibly stupid idea today of running the stdlib through pylint. Has anybody written a pylintrc file that attempts to reflect the recommendations of PEP 8 the extent possible? Thx, Skip ___ Python-Dev mailing list Python-Dev@python.org http://

Re: [Python-Dev] windows buildbot failures

2006-04-23 Thread Andrew MacIntyre
Tim Peters wrote: > [Andrew MacIntyre] Hmm... I don't appear to have explained what I meant very well :-| {...} > This really needs an executable example. Here's my best guess about > what you mean, but I don't see any of what you're describing on WinXP > Pro SP2: And a pretty good guess it w

Re: [Python-Dev] windows buildbot failures

2006-04-23 Thread Tim Peters
[Martin] > I see a similar phenomenon (sp?) Yup! The plural is phenomena. > on XP SP2: test_mailbox fails to > me, with permission denied in some (random) test. I believe this > is due to Tortoise SVN: test_mailbox creates a few directories, > then Tortoise detects them (thanks to file change no

Re: [Python-Dev] Why are contexts also managers? (wasr45544-peps/trunk/pep-0343.txt)

2006-04-23 Thread Terry Reedy
"Just van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> +1 for context maker. >Or maybe "context factory"? Yes, I thought of that too. Latin 'facere' == 'to make'. I might even put a sentence in the doc explaining that a context maker is a context factory, in the CS

Re: [Python-Dev] Why are contexts also managers? (wasr45544-peps/trunk/pep-0343.txt)

2006-04-23 Thread Terry Reedy
"Baptiste Carvello" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >+1 for context maker. [me, Terry] >> I would call the decorator @contextmaker since that is what it turns the >> >> decorated function into. >I'm confused here. Do we agree that the object with __enter__ and > >

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Nick Coghlan
Nick Coghlan wrote: > For those not following along at home, I've now updated PEP 343 to clarify my > originally intended meanings for various terms, and to record the fact that > we > don't currently have a consensus on python-dev that those are the right > definitions. > > As written up in t

Re: [Python-Dev] windows buildbot failures

2006-04-23 Thread Martin v. Löwis
Tim Peters wrote: >> I've never reported this as a Python bug > > If you do, I'll probably add a comment like the above ;-) > >> because I've considered the antivirus SW likely to be the culprit. > > Could be. FWIW, Norton AV was running during the above. I see a similar phenomenon (sp?) on XP

Re: [Python-Dev] Win64 AMD64 (aka x64) binaries available64

2006-04-23 Thread Martin v. Löwis
Anthony Baxter wrote: > On Saturday 22 April 2006 15:27, Neal Norwitz wrote: >> In case it wasn't clear, the /Wp64 flag is available in icc >> (Intel's C compiler). > > Is it worth turning this on for the icc ubuntu buildbot? Anyone got > ideas on the best way to do this? Should I just set CFLAGS

Re: [Python-Dev] Win64 AMD64 (aka x64) binaries available64

2006-04-23 Thread Anthony Baxter
On Saturday 22 April 2006 15:27, Neal Norwitz wrote: > In case it wasn't clear, the /Wp64 flag is available in icc > (Intel's C compiler). Is it worth turning this on for the icc ubuntu buildbot? Anyone got ideas on the best way to do this? Should I just set CFLAGS="-Wp64" before running the bui

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Nick Coghlan
Paul Moore wrote: > On 4/23/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> For those not following along at home, I've now updated PEP 343 to clarify my >> originally intended meanings for various terms, and to record the fact that >> we >> don't currently have a consensus on python-dev that those

Re: [Python-Dev] With context, please

2006-04-23 Thread Paul Moore
On 4/23/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > - contextlib.contextmanager() > - is actually used to define contexts according to the current docs > - but returns a GeneratorContextManager object You may just be trying to avoid overcomplicating things by adding too much detail

Re: [Python-Dev] magic in setuptools (Was: setuptools in the stdlib)

2006-04-23 Thread Paul Moore
On 4/23/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 01:19 PM 4/23/2006 +1000, Anthony Baxter wrote: > >On Sunday 23 April 2006 11:43, Nick Coghlan wrote: > > > Maybe we need something that's the equivalent of alien (rpm -> dpkg > > > converter), so that given an egg, one can easily get a nat

Re: [Python-Dev] Why are contexts also managers? (wasr45544 -peps/trunk/pep-0343.txt)

2006-04-23 Thread Just van Rossum
Baptiste Carvello wrote: > Terry Reedy a écrit : > > So I propose that the context maker be called just that: 'context > > maker'. That should pretty clearly not be the context that manages > > the block execution. > > > +1 for context maker. In fact, after reading the begining of the > thread, I

Re: [Python-Dev] patch #1454481 - runtime tunable thread stack size

2006-04-23 Thread Andrew MacIntyre
Terry Reedy wrote: > If you checked it in (after tests pass on your ?mac?, and while being ready > to revert), wouldn't the next buildbot cycle do the testing you need? > Isn't testing on 'other' platforms what buildbot is for? Only up to a point... In this case, I was after code review as muc

Re: [Python-Dev] Why are contexts also managers? (wasr45544 -peps/trunk/pep-0343.txt)

2006-04-23 Thread Baptiste Carvello
Terry Reedy a écrit : > So I propose that the context maker be called just that: 'context maker'. > That should pretty clearly not be the context that manages the block > execution. > +1 for context maker. In fact, after reading the begining of the thread, I came up with the very same idea.

Re: [Python-Dev] With context, please

2006-04-23 Thread Nick Coghlan
Phillip J. Eby wrote: > Read the first sentence again: > > "EXPRESSION returns a value that the with statement uses to *create* a > context" (emphasis added). > > It doesn't say that the value *is* the context, and if anything, the > second excerpt supports that by implying that the context man