You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PEP 3121 Refactoring applied to _csv module #58937
This patch presents my first try to apply the proposed Refactoring of PEP-3121 to the csv module. I have identified three mutable global variables inside the module, two of which are references to PyObjects. I have wrapped all of them inside a dedicated struct, which is traversed by the gc after "freeing" the module. I also defined some macros, to hide functions calls that are now needed because of the newly introduced indirections.
The following script should fail before you have applied the bespoken patch: It basically checks wether one of the global PyObjects inside the csv module is being deleted after freeing the csv module.
PyModule_AddObject steals the value's reference, so you need to INCREF it before. Besides that, I don't see any obvious bug, but perhaps Martin wants to take a look.
Skip: I used the nosy field autocomplete which is based on the experts file in the devguide; I can mark you "retired" in that file so that your name does not show up in autocomplete (but humans will still know that you might be contacted when all else fails, unless you prefer your name to be fully removed).
Skip: I used the nosy field autocomplete which is based on the experts file in the devguide; I can mark you "retired" in that file so that your name does not show up in autocomplete (but humans will still know that you might be contacted when all else fails, unless you prefer your name to be fully removed).
Thanks. That would be great. I don't mind the occasional question,
but don't want people thinking I am going to jump in feet first any
time I'm made nosy on a ticket.
Robin, I forgot: could you please sign and send the contrib form at http://www.python.org/psf/contrib/ ?
It is not a copyright assignment, just a piece of paper that formally allows us to license your contribution for distribution with Python.
Activity
RobinSchreiber commentedon May 5, 2012
This patch presents my first try to apply the proposed Refactoring of PEP-3121 to the csv module. I have identified three mutable global variables inside the module, two of which are references to PyObjects. I have wrapped all of them inside a dedicated struct, which is traversed by the gc after "freeing" the module. I also defined some macros, to hide functions calls that are now needed because of the newly introduced indirections.
RobinSchreiber commentedon May 5, 2012
The following script should fail before you have applied the bespoken patch: It basically checks wether one of the global PyObjects inside the csv module is being deleted after freeing the csv module.
smontanaro commentedon May 8, 2012
Thanks, but I'm out of the Python development business, except as it
pertains to my day job...
Skip
pitrou commentedon May 8, 2012
PyModule_AddObject steals the value's reference, so you need to INCREF it before. Besides that, I don't see any obvious bug, but perhaps Martin wants to take a look.
merwok commentedon May 11, 2012
Skip: I used the nosy field autocomplete which is based on the experts file in the devguide; I can mark you "retired" in that file so that your name does not show up in autocomplete (but humans will still know that you might be contacted when all else fails, unless you prefer your name to be fully removed).
smontanaro commentedon May 11, 2012
Thanks. That would be great. I don't mind the occasional question,
but don't want people thinking I am going to jump in feet first any
time I'm made nosy on a ticket.
S
python-dev commentedon May 13, 2012
New changeset 90cf321615e5 by Antoine Pitrou in branch 'default':
Remove Skip from the csv experts (see issue bpo-14732).
http://hg.python.org/devguide/rev/90cf321615e5
python-dev commentedon May 16, 2012
New changeset 2496602a56e5 by Antoine Pitrou in branch 'default':
Issue bpo-14732: The _csv module now uses PEP-3121 module initialization.
http://hg.python.org/cpython/rev/2496602a56e5
pitrou commentedon May 16, 2012
Thanks for the updated patch, Robin. I have now committed it to the default branch.
pitrou commentedon May 16, 2012
Robin, I forgot: could you please sign and send the contrib form at http://www.python.org/psf/contrib/ ?
It is not a copyright assignment, just a piece of paper that formally allows us to license your contribution for distribution with Python.