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 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 ctypes wrapper for each C t

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 c

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

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, P.J. Eby 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 the module. > > Ha

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

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Neil Schemenauer 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 rel

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 really

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" 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 pl

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

2010-10-26 Thread Neil Schemenauer
Peter Ingebretson 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 accepted. Martin's su

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" 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. > > I

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" 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 chanc

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" 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. Thanks, Peter

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

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

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Benjamin Peterson 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 speed of iteration t

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

2010-10-26 Thread Peter Ingebretson
--- On Tue, 10/26/10, Hrvoje Niksic 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 original thought was

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

2010-10-26 Thread Benjamin Peterson
2010/10/26 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

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 correspon