Re: [Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2))

2005-12-29 Thread Bob Ippolito
On Dec 27, 2005, at 9:05 AM, Andrea Arcangeli wrote: I run into a problem recently with a reconnectingclientfactory with twisted while write some spare time software, that turned out to be a gc inefficiency. In short the protocol memory wasn't released after the reconnect and the

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Fredrik Lundh
(for those who follow non-python forums make that those who don't follow /F ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] When do sets shrink?

2005-12-29 Thread Fredrik Lundh
Martin v. Löwis wrote: Adal Chiriliuc wrote: MSVC 7.1 and 8.0 malloc always uses the Windows heap functions (HeapAlloc friends) if running on Windows 2000 or newer (malloc.c and heapinit.c). So it seems that for both Linux (gcc) and Win (msvc) the memory is released to the operating

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread skip
(for those who follow non-python forums Fredrik make that those who don't follow What might some of those non-python forums be? Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

[Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Martin v. Löwis
Please let me know what you think. Regards, Martin PEP: XXX Title: Using ssize_t as the index type Version: $Revision$ Last-Modified: $Date$ Author: Martin v. Löwis [EMAIL PROTECTED] Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 18-Dec-2005 Post-History: Abstract

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Fredrik make that those who don't follow What might some of those non-python forums be? assorted corners of the blogosphere, mostly. no time to dig up any explicit references, since I'm preparing for a 650 km trip through a major snowstorm, but searching

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Aahz
On Wed, Dec 28, 2005, Guido van Rossum wrote: In the mean time I'm a strong believer in it ain't broke so don't fix it here. Does that also include my suggestion about improving the startup message? -- Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/ Given that C++

Re: [Python-Dev] NotImplemented reaching top-level

2005-12-29 Thread M.-A. Lemburg
Hi Armin, On Wed, Dec 28, 2005 at 09:56:43PM +0100, M.-A. Lemburg wrote: d += 1.2 d NotImplemented The PEP documenting the coercion logic has complete tables for what should happen: Well, '+=' does not invoke coercion at all, with new-style classes like Decimal. True, it doesn't invoke

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Guido van Rossum
On 12/29/05, Aahz [EMAIL PROTECTED] wrote: On Wed, Dec 28, 2005, Guido van Rossum wrote: In the mean time I'm a strong believer in it ain't broke so don't fix it here. Does that also include my suggestion about improving the startup message? Nobody reads that; plus it looks like it's

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Guido van Rossum
+1. I think this is long overdue. While I can't judge the amount of code breakage, 2.5 is as good an opportunity as any. --Guido On 12/29/05, Martin v. Löwis [EMAIL PROTECTED] wrote: Please let me know what you think. Regards, Martin PEP: XXX Title: Using ssize_t as the index type

[Python-Dev] Bug in Py_InitModule4

2005-12-29 Thread Collin Winter
Hello all, While working with Subversion's python API bindings this morning, I discovered a function in one of their modules illegally named import (svn.client.import, for the curious). Because the extension module in question is written in C, the interpreter doesn't flag the otherwise-illegal

Re: [Python-Dev] When do sets shrink?

2005-12-29 Thread Guido van Rossum
On 12/29/05, Noam Raphael [EMAIL PROTECTED] wrote: On 12/29/05, Donovan Baarda [EMAIL PROTECTED] wrote: Without some sort of fancy overkill size hinting or history tracking, that's probably as good a heuristic as you can get. I'm sorry, but it's not correct. There's a simple resize

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Fredrik Lundh
Aahz wrote: Does that also include my suggestion about improving the startup message? when newbies get to the point that they want to quit, chances are that the message have scrolled out of sight. and if they only skim the instructions, they'll probably get confused anyway... e.g. Python

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Fernando Perez
Walter Dörwald wrote: Alex Martelli wrote: On 12/28/05, Walter Dörwald [EMAIL PROTECTED] wrote: ... We have sys.displayhook and sys.excepthook. Why not add a sys.inputhook? Sure, particularly with Nick's suggestion for a default input hook it would be fine. I'd like the inputhook to

Re: [Python-Dev] When do sets shrink?

2005-12-29 Thread Fredrik Lundh
Noam Raphael wrote: I'm not saying that practically it must be used - I'm just saying that it can't be called a heuristic, and that it doesn't involve any fancy overkill size hinting or history tracking. It actually means something like this: 1. If you want to insert and the table is full,

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Aahz
Not sure what I think of the proposal (though I guess I'm overall +0 -- needs to be done sometime and no time like the present). However, I think this PEP should be held up as an example of how to write a good PEP. Aside from my inability to follow some of the arcane points due to lack of C

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Martin v. Löwis
Aahz wrote: However, I think this PEP should be held up as an example of how to write a good PEP. Aside from my inability to follow some of the arcane points due to lack of C programming skill, this PEP was extremely readable and well-organized. Nice job! Thanks! Part of it probably stems

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Fredrik Lundh
Fernando Perez wrote: In [1]: x='hello' In [2]: x? /.../ Docstring: str(object) - string Return a nice string representation of the object. If the argument is a string, the return value is the same object. I'm not sure what I find more confusing: a help system that claims

Re: [Python-Dev] When do sets shrink?

2005-12-29 Thread Donovan Baarda
On Thu, 2005-12-29 at 17:17 +0100, Fredrik Lundh wrote: Noam Raphael wrote: I'm not saying that practically it must be used - I'm just saying that it can't be called a heuristic, and that it doesn't involve any fancy overkill size hinting or history tracking. It actually means something

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Fredrik Lundh
Guido van Rossum wrote: Regarding the meme floating about the arrogance of Pythoneers: bloggers (pretty much by definition) are actually the most arrogant species; don't confuse bloggers say with most people think. Sure, but I'm not only talking about the mindless ranters here; it's also

Re: [Python-Dev] When do sets shrink?

2005-12-29 Thread Noam Raphael
On 12/29/05, Fredrik Lundh [EMAIL PROTECTED] wrote: Noam Raphael wrote: I'm not saying that practically it must be used - I'm just saying that it can't be called a heuristic, and that it doesn't involve any fancy overkill size hinting or history tracking. It actually means something like

Re: [Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2))

2005-12-29 Thread Andrea Arcangeli
On Thu, Dec 29, 2005 at 04:22:35AM -0500, Bob Ippolito wrote: In this particular case, you might be better off just writing some Twisted code that periodically checks the size of the current process and does a gc.collect() when necessary. Of course, it requires some platform specific

Re: [Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2))

2005-12-29 Thread Andrea Arcangeli
On Wed, Dec 28, 2005 at 07:14:32PM -0700, Neil Schemenauer wrote: [This message has also been posted.] Martin v. Löwis [EMAIL PROTECTED] wrote: One challenge is that PyObject_GC_Del doesn't know how large the memory block is that is being released. So it is difficult to find out how much

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Armin Rigo
Hi Martin, On Thu, Dec 29, 2005 at 03:04:30PM +0100, Martin v. L?wis wrote: New conversion functions PyInt_FromSsize_t, PyInt_AsSsize_t, PyLong_AsSsize_t are introduced. PyInt_FromSsize_t will transparently return a long int object if the value exceeds the MAX_INT. I guess you mean LONG_MAX

Re: [Python-Dev] floating point literals don't work in non-US locale in 2.5

2005-12-29 Thread Guido van Rossum
Not the first time this happened. :-( Could someone add a unit test for this please? --Guido On 12/28/05, Fredrik Lundh [EMAIL PROTECTED] wrote: someone recently broke floating point literals in a rather spectacular way: $ export LANG=sv_SE.utf8 $ ./python Python 2.5a0 (41806M, Dec 25

Re: [Python-Dev] floating point literals don't work in non-USlocale in 2.5

2005-12-29 Thread Fredrik Lundh
Guido wrote: Not the first time this happened. :-( Could someone add a unit test for this please? Hye-Shik Chang just added the necessary tests to his bugfix patch. I'll check this in later tonight. /F ___ Python-Dev mailing list

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Michael Chermside
The F-bot writes: in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current solution with the same energy, no matter what it

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Martin v. Löwis
Michael Chermside wrote: Seriously... I've seen this behavior also, but I haven't ever thought about it as clearly as Fredrik does here. When we go to answer questions we ought to pause briefly first and decide which of these categories applies to a given piece of behavior. I think users will

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Samuele Pedroni
Michael Chermside wrote: The F-bot writes: in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current solution with the same

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Scott David Daniels
Aahz wrote: On Wed, Dec 28, 2005, Brett Cannon wrote: On 12/28/05, Aahz [EMAIL PROTECTED] wrote: Here's yet a different take on this: .. change the startup message... Type help, copyright, credits or license for more information. Let's add another line that says Type quit() to exit

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Tim Peters
[Martin v. Löwis] ... PEP: XXX Title: Using ssize_t as the index type +1, and for Python 2.5, and the sooner done the less painful for all. Same concerns as Armin, where this is especially unattractive: The conversion codes 's#' and 't#' will output Py_ssize_t if the macro PY_SIZE_T_CLEAN

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Brett Cannon
On 12/29/05, Martin v. Löwis [EMAIL PROTECTED] wrote: Please let me know what you think. Regards, Martin PEP: XXX Title: Using ssize_t as the index type [SNIP] +1 from me. As everyone else is saying, this has to happen at some point and 2.5 is as good as any. -Brett

Re: [Python-Dev] [Doc-SIG] that library reference, again

2005-12-29 Thread David Goodger
On 12/29/05, Fredrik Lundh [EMAIL PROTECTED] wrote: however, given that the discussion that led up to this has been dead for almost a week, You mean since Christmas? I'm beginning to fear that I've wasted my time on a project that nobody's interested in. Could be. I don't see HTML+PythonDoc

Re: [Python-Dev] [Doc-SIG] that library reference, again

2005-12-29 Thread Fredrik Lundh
David Goodger wrote: however, given that the discussion that led up to this has been dead for almost a week, You mean since Christmas? I'm beginning to fear that I've wasted my time on a project that nobody's interested in. Could be. I don't see HTML+PythonDoc as a significant

Re: [Python-Dev] New PEP: Using ssize_t as the index type

2005-12-29 Thread Fredrik Lundh
Martin v. Löwis wrote: Please let me know what you think. +1. in honor of the Bike Shed Effect, I'm going to assume that you've thought of everything. ::: well, one thing seems to missing from your PEP: in several modules, you've changed the cast used in the type table. e.g. ---

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Neil Schemenauer
Scott David Daniels [EMAIL PROTECTED] wrote: Or, perhaps: class _Quitter(str): def __call__(self): raise SystemExit quit = _Quitter('The quit command. Type quit() to exit') exit = _Quitter('The exit command. Type exit() to exit') FWIW, I like this kind of solution

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Nick Coghlan
Neil Schemenauer wrote: Scott David Daniels [EMAIL PROTECTED] wrote: Or, perhaps: class _Quitter(str): def __call__(self): raise SystemExit quit = _Quitter('The quit command. Type quit() to exit') exit = _Quitter('The exit command. Type exit() to exit') FWIW, I

Re: [Python-Dev] [Doc-SIG] that library reference, again

2005-12-29 Thread David Goodger
[Fredrik Lundh] I'm beginning to fear that I've wasted my time on a project that nobody's interested in. [David Goodger] Could be. I don't see HTML+PythonDoc as a significant improvement over LaTeX. [Fredrik Lundh] Really? Yes, really. Have you read my list of goals? Yes, and I mostly

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Nick Coghlan
Samuele Pedroni wrote: Michael Chermside wrote: The F-bot writes: in reality, some things are carefully thought out and craftily im- plemented, some things are engineering tradeoffs made at a certain time, and some things are just accidents -- but python-dev will happily defend the current

[Python-Dev] Naming conventions in Py3K

2005-12-29 Thread Ka-Ping Yee
In a fair number of cases, Python doesn't follow its own recommended naming conventions. Changing these things would break backward compatibility, so they are out of the question for Python 2.*, but it would be nice to keep these in mind for Python 3K. Constants in all caps: NONE,

Re: [Python-Dev] a quit that actually quits

2005-12-29 Thread Stephen J. Turnbull
Nick == Nick Coghlan [EMAIL PROTECTED] writes: Nick Samuele Pedroni wrote: It's not a matter of defending the status quo, more about what kind of price is reasonable for DWIM. IMHO, +N*10^6 for simplicity, regularity, and discoverability, -1 for DWIM in the interpreter. DWIM is

Re: [Python-Dev] Naming conventions in Py3K

2005-12-29 Thread Brett Cannon
On 12/29/05, Ka-Ping Yee [EMAIL PROTECTED] wrote: In a fair number of cases, Python doesn't follow its own recommended naming conventions. Changing these things would break backward compatibility, so they are out of the question for Python 2.*, but it would be nice to keep these in mind for

Re: [Python-Dev] [Doc-SIG] that library reference, again

2005-12-29 Thread Robey Pointer
On 29 Dec 2005, at 18:58, David Goodger wrote: [Fredrik Lundh] I'm beginning to fear that I've wasted my time on a project that nobody's interested in. [David Goodger] Could be. I don't see HTML+PythonDoc as a significant improvement over LaTeX. [Fredrik Lundh] Really? Yes, really.

Re: [Python-Dev] [Doc-SIG] that library reference, again

2005-12-29 Thread Fredrik Lundh
Robey Pointer wrote: [Fredrik Lundh] Really? Yes, really. Just out of curiosity (really -- not trying to jump into the flames) why not just use epydoc? If it's good enough for 3rd-party python libraries, isn't that just a small step from being good enough for the builtin libraries?

Re: [Python-Dev] Python + Visual C++ 8.0?

2005-12-29 Thread Ralf W. Grosse-Kunstleve
--- Martin v. Löwis [EMAIL PROTECTED] wrote: Out of curiosity: can you please try invoking this enum_print to stdout with your VS2005-built boost module? I see it uses fprintf, so I would expect it to crash. After beating on this for half an hour I am coming to the conclusion that there is no