Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-27 Thread Hrvoje Niksic
On 10/26/2010 07:11 PM, Peter Ingebretson wrote: The main argument is that preserving immutable objects increases the complexity of remapping and does not actually solve many problems. The primary reason for objects to be immutable is so that their comparison operators and hash value can remain

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-27 Thread exarkun
On 26 Oct, 11:31 pm, pinge...@yahoo.com wrote: --- On Tue, 10/26/10, exar...@twistedmatrix.com exar...@twistedmatrix.com wrote: This can be implemented with ctypes right now (I half did it several years ago). Jean-Paul Is there a trick to doing it this way, or are you suggesting building a

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Hrvoje Niksic
On 10/26/2010 07:04 AM, Peter Ingebretson wrote: I have a patch that adds a new function to the gc module. The gc.remap() function uses the tp_traverse mechanism to find all references to any keys in a provided mapping, and remaps these references in-place to instead point to the value

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Benjamin Peterson
2010/10/26 Peter Ingebretson pinge...@yahoo.com: I have a patch that adds a new function to the gc module.  The gc.remap() function uses the tp_traverse mechanism to find all references to any keys in a provided mapping, and remaps these references in-place to instead point to the value

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Hrvoje Niksic hrvoje.nik...@avl.com wrote: What about objects that don't implement tp_traverse because they cannot take part in cycles? A significant majority of objects that can hold references to other objects can take part in cycles and do implement tp_traverse. My

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Benjamin Peterson benja...@python.org wrote: Is there any reason that you'd want to do this? http://doublestar.org/python-hot-loading-prototype/ I have a relatively large application written in Python, and a specific use case where it will significantly increase our

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Martin v. Löwis
Am 26.10.2010 19:24, schrieb Peter Ingebretson: --- On Tue, 10/26/10, Benjamin Peterson benja...@python.org wrote: Is there any reason that you'd want to do this? http://doublestar.org/python-hot-loading-prototype/ I have a relatively large application written in Python, and a specific use

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Martin v. Löwis mar...@v.loewis.de wrote: I think this then mandates a PEP; I'm -1 on the feature also. I am happy to write up a PEP for this feature. I'll start that process now, though if anyone feels that this idea has no chance of acceptance please let me know.

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Martin v. Löwis
Am 26.10.2010 22:28, schrieb Peter Ingebretson: --- On Tue, 10/26/10, Martin v. Löwis mar...@v.loewis.de wrote: I think this then mandates a PEP; I'm -1 on the feature also. I am happy to write up a PEP for this feature. I'll start that process now, though if anyone feels that this idea

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Martin v. Löwis mar...@v.loewis.de wrote: I think this then mandates a PEP; I'm -1 on the feature also. I am happy to write up a PEP for this feature.  I'll start that process now, though if anyone feels that this idea has no chance of acceptance please let me know.

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Neil Schemenauer
Peter Ingebretson pinge...@yahoo.com wrote: I am happy to write up a PEP for this feature. I'll start that process now, though if anyone feels that this idea has no chance of acceptance please let me know. I think a feature that allows modules to be more reliability reloaded could be

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread exarkun
On 08:28 pm, pinge...@yahoo.com wrote: --- On Tue, 10/26/10, Martin v. L�wis mar...@v.loewis.de wrote: I think this then mandates a PEP; I'm -1 on the feature also. I am happy to write up a PEP for this feature. I'll start that process now, though if anyone feels that this idea has no chance

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread P.J. Eby
At 10:24 AM 10/26/2010 -0700, Peter Ingebretson wrote: I have a relatively large application written in Python, and a specific use case where it will significantly increase our speed of iteration to be able to change and test modules without needing to restart the application. If all you

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Neil Schemenauer n...@arctrix.com wrote: I am happy to write up a PEP for this feature.  I'll start that process now, though if anyone feels that this idea has no chance of acceptance please let me know. I think a feature that allows modules to be more

Re: [Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, P.J. Eby p...@telecommunity.com wrote: If all you really want this for is reloading, it would probably make more sense to simply modify the existing class and function objects using the reloaded values as a template, then save the modified classes and functions back to

[Python-Dev] Issue 10194 - Adding a gc.remap() function

2010-10-25 Thread Peter Ingebretson
I have a patch that adds a new function to the gc module.  The gc.remap() function uses the tp_traverse mechanism to find all references to any keys in a provided mapping, and remaps these references in-place to instead point to the value corresponding to each key. The motivation for adding