Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Georg Brandl
On 07.05.2011 01:25, Greg Ewing wrote: > Neal Becker wrote: >> http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html > > There, Linus says > >> For example, if you have an _explicit_ refcounting system, then it is >> quite natural to have operations like ... >> >> note_t *node = *np; >>

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Glyph Lefkowitz
Apologies in advance for contributing to an obviously and increasingly off-topic thread, but this kind of FUD about GC is a pet peeve of mine. On May 6, 2011, at 10:04 AM, Neal Becker wrote: > http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html Counterpoint: . Sorr

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Greg Ewing
Stefan Behnel wrote: After all, the described crash case indicates that the Document destructor was called before all of the Element destructors had been called, although all Elements reference their Document, but the Document does not refer to any of the Elements, In that case, why was the G

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Greg Ewing
Mark Shannon wrote: With a tracing GC: While the Elements are finalized, the Document is still alive. While the Document is finalized, the Elements are still alive. Then, and only then, is the whole lot reclaimed. One problem is that, at the C level in CPython, you can't separate finalisation

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Nick Coghlan
Even if he's right (and he probably is) manual memory management is still a premature optimization for most applications. C and C++ data structures are a PITA because you have to be so careful to avoid leaks and double-frees, so people end up using dumb algorithms. Worrying about losing cycles w

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Greg Ewing
Mark Shannon wrote: For example, a file object will close itself during finalization, but its still a valid object, just a closed file rather than an open one. It might be valid in the sense that you won't get a segfault. But the point is that the destructors of some objects may be relying on

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Greg Ewing
Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html From that note: 1: You can't have meaningful destructors, because when destruction happens is undefined. And going-out-of-scope destructors are extremely useful. Python is already a rather broken in thi

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Greg Ewing
Neal Becker wrote: http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html There, Linus says For example, if you have an _explicit_ refcounting system, then it is quite natural to have operations like ... note_t *node = *np; if (node->count > 1)

Re: [Python-Dev] Problems with regrtest and with logging

2011-05-06 Thread R. David Murray
On Fri, 06 May 2011 19:51:31 +0200, =?UTF-8?Q?=C3=89ric_Araujo?= wrote: > regrtest helpfully reports when a test leaves the environment unclean > (sys.path, os.environ, logging._handlerList), but I think the > implementation is buggy: it compares object identity and then value. > Why is comparing

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Dan Stromberg
On Fri, May 6, 2011 at 7:04 AM, Neal Becker wrote: > http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html > Of course, a generational GC improves locality of reference. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinf

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stefan Behnel
Mark Shannon, 06.05.2011 20:45: Stefan Behnel wrote: Michael Foord, 06.05.2011 19:06: On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/merc

Re: [Python-Dev] Problems with regrtest and with logging

2011-05-06 Thread Vinay Sajip
Éric Araujo netwok.org> writes: > Second: in packaging, we have two modules that create a logging > handler. I’m not sure how if we should change the code or fix the tests > to restore the _handlerList, or how. If you are saying this happens in your unit tests for packaging, then you can

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Mark Shannon
Stefan Behnel wrote: Michael Foord, 06.05.2011 19:06: On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-06 Thread Georg Brandl
On 06.05.2011 12:27, Antoine Pitrou wrote: > On Fri, 06 May 2011 13:28:11 +1200 > Greg Ewing wrote: > >> Amaury Forgeot d'Arc wrote [concerning the Doc/data/refcounts.dat file]: >> >> > This is not always true, for example when the item is already present >> > in the dict. >> > It's not importan

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-06 Thread Georg Brandl
On 06.05.2011 10:18, Amaury Forgeot d'Arc wrote: > Le vendredi 6 mai 2011, Mark Shannon a écrit : >> What about #defining PY_STOLEN in some header? >> >> Then any stolen parameter can be prefixed with PY_STOLEN in signature. >> >> For return values, similarly #define PY_BORROWED. > > Header files

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stefan Behnel
Michael Foord, 06.05.2011 19:06: On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html From that note: 1:

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread skip
Michael> "Therefore we decided to break such a cycle at an arbitrary Michael> place, which doesn't sound too insane." I trust "arbitrary" != "random"? Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinf

[Python-Dev] Problems with regrtest and with logging

2011-05-06 Thread Éric Araujo
Hi, Sorry for quick email-battery dying. regrtest helpfully reports when a test leaves the environment unclean (sys.path, os.environ, logging._handlerList), but I think the implementation is buggy: it compares object identity and then value. Why is comparing identity useful? I’d just use ==

Re: [Python-Dev] cpython (3.2): Avoid codec spelling issues by just using the utf-8 default.

2011-05-06 Thread Éric Araujo
Le 06/05/2011 00:52, Terry Reedy a écrit : On 5/5/2011 4:55 PM, Raymond Hettinger wrote: Either way, the code is simpler by just using the default. I thought about this and decided that the purpose of having defaults is so one does not have to always spell it out. So use it. Readers can always

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Mark Shannon
Michael Foord wrote: On 06/05/2011 18:26, Mark Shannon wrote: Michael Foord wrote: On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercuri

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Michael Foord
On 06/05/2011 18:07, Glyph Lefkowitz wrote: On May 6, 2011, at 12:31 PM, Michael Foord wrote: pypy and .NET choose to arbitrarily break cycles rather than leave objects unfinalised and memory unreclaimed. Not sure what Java does. I think that's a mischaracterization of their respective collec

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stephen J. Turnbull
Mark Shannon writes: > > > Neal Becker wrote: > > http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html > > > Being famous does not necessarily make you right. No, but being a genius sure helps you beat the odds. > OS kernels are pretty atypical software, > even if Linus is right about Linux

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Glyph Lefkowitz
On May 6, 2011, at 12:31 PM, Michael Foord wrote: > pypy and .NET choose to arbitrarily break cycles rather than leave objects > unfinalised and memory unreclaimed. Not sure what Java does. I think that's a mischaracterization of their respective collectors; "arbitrarily break cycles" implies t

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Michael Foord
On 06/05/2011 17:51, Stefan Behnel wrote: Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html From that note: 1: You can't have meaningful destruc

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Michael Foord
On 06/05/2011 17:32, Gregory P. Smith wrote: On Fri, May 6, 2011 at 9:18 AM, wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html > From that note: 1: You can't have meaningful dest

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Stefan Behnel
Mark Shannon, 06.05.2011 18:33: s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html From that note: 1: You can't have meaningful destructors, because when destruction happens is u

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Mark Shannon
s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html From that note: 1: You can't have meaningful destructors, because when destruction happens is undefined. And go

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Gregory P. Smith
On Fri, May 6, 2011 at 9:18 AM, wrote: > >    Antoine> Since we're sharing links, here's Matt Mackall's take: >    Antoine> > http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html > > >From that note: > >    1: You can't have meaningful destructors, because when destruction >    

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Michael Foord
On 06/05/2011 17:18, s...@pobox.com wrote: Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html > From that note: 1: You can't have meaningful destructors, because when destruction h

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread skip
Antoine> Since we're sharing links, here's Matt Mackall's take: Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html >From that note: 1: You can't have meaningful destructors, because when destruction happens is undefined. And going-out-of-scope destruc

[Python-Dev] Summary of Python tracker Issues

2011-05-06 Thread Python tracker
ACTIVITY SUMMARY (2011-04-29 - 2011-05-06) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open2783 (+23) closed 21017 (+41) total 23800 (+64) Open issues wit

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Antoine Pitrou
On Fri, 06 May 2011 15:46:08 +0100 Mark Shannon wrote: > > Neal Becker wrote: > > http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html > > > Being famous does not necessarily make you right. > > OS kernels are pretty atypical software, > even if Linus is right about Linux, it doesn't apply to Python

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Mark Shannon
Neal Becker wrote: http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html Being famous does not necessarily make you right. OS kernels are pretty atypical software, even if Linus is right about Linux, it doesn't apply to Python. I have empirical evidence, not opinion, that PyPy and my own HotPy ar

Re: [Python-Dev] Linus on garbage collection

2011-05-06 Thread Antoine Pitrou
On Fri, 06 May 2011 10:04:09 -0400 Neal Becker wrote: > http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html Since we're sharing links, here's Matt Mackall's take: http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html cheers Antoine. ___

[Python-Dev] Linus on garbage collection

2011-05-06 Thread Neal Becker
http://gcc.gnu.org/ml/gcc/2002-08/msg00552.html ___ 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/archive%40mail-archive.com

Re: [Python-Dev] [Python-checkins] cpython: Userlist.copy() wasn't returning a UserList.

2011-05-06 Thread Jim Jewett
Do you also want to assert that u is not v, or would that sort of "copy" be acceptable by some subclasses? On 5/5/11, raymond.hettinger wrote: > http://hg.python.org/cpython/rev/f20373fcdde5 > changeset: 69865:f20373fcdde5 > user:Raymond Hettinger > date:Thu May 05 14:34:35 201

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-06 Thread Mark Shannon
Antoine Pitrou wrote: On Fri, 06 May 2011 13:28:11 +1200 Greg Ewing wrote: Amaury Forgeot d'Arc wrote [concerning the Doc/data/refcounts.dat file]: This is not always true, for example when the item is already present in the dict. It's not important to know what the function does to the obje

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-06 Thread Antoine Pitrou
On Fri, 06 May 2011 13:28:11 +1200 Greg Ewing wrote: > Amaury Forgeot d'Arc wrote [concerning the Doc/data/refcounts.dat file]: > > > This is not always true, for example when the item is already present > > in the dict. > > It's not important to know what the function does to the object, > > On

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-06 Thread Amaury Forgeot d'Arc
Le vendredi 6 mai 2011, Mark Shannon a écrit : > What about #defining PY_STOLEN in some header? > > Then any stolen parameter can be prefixed with PY_STOLEN in signature. > > For return values, similarly #define PY_BORROWED. Header files are harder to parse, and I don't see how it would apply to

Re: [Python-Dev] Borrowed and Stolen References in API

2011-05-06 Thread Mark Shannon
s...@pobox.com wrote: Georg> Let's remove the cruft, and only keep interesting info. This Georg> will also make the file much more manageable. If I was to do this from scratch I'd think hard about annotating the source code. No matter how hard you try, if you keep this information sepa