Re: [Python-Dev] With context, please

2006-04-23 Thread Phillip J. Eby
At 01:33 PM 4/23/2006 +1000, Nick Coghlan wrote: Phillip J. Eby wrote: At 09:25 AM 4/22/2006 -0700, Aahz wrote: EXPRESSION returns a value that the with statement uses to create a context (a special kind of namespace). The context is used to execute the BLOCK. The block might end

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

2006-04-23 Thread Martin v. Löwis
Kirat Singh wrote: Hi, this is my first python dev post, so please forgive me if this topic has already been discussed. To my knowledge, this hasn't been discussed before. It seemed to me that removing me_hash from a dict entry would save 2/3 of the space used by dictionaries and also

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 manager is

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] 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 much

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 native

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] 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 are the

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

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=-Wp64

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 SP2:

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 the

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 __exit__ is a

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 sense of

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

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 was

[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

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] 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 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] 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 directly, using

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, or

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] 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

[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 about

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 Iterator

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 begining of the

[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() def

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 whether