homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients christian.heimes, eli.bendersky, loewis, ncoghlan, pitrou, vstinner
Date 2013年08月12日.13:55:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376315727.21.0.914891851376.issue18710@psf.upfronthosting.co.za>
In-reply-to
Content
The patched code looks better than the original one in several respects, but I think it raises some questions.
I agree with Victor that the type-checking API is unnatural, but I also think there may be a deeper issue hiding behind. You felt compelled to add the type-checking to provide some level of safety to the C code - but is it enough? Previously, the only way to add a dialect was through register_dialect that does type checking to make sure it gets a legit dialect object. Now, the _dialects dict is directly accessible to Python code and it can add arbitrary objects to it (both as keys and as values). Does this mean that the C code now has to do type checking in all internal code that accesses _dialects? I haven't had time to find a crasher example, but it's plausible that it's possible to crash the interpreter now by assigning un-expected stuff to members of _dialects.
Maybe it's not a problem in practice for _csv but something worth thinking about if we're going to switch other methods to this approach.
Also, the problem with http://mail.python.org/pipermail/python-dev/2013-August/127862.html does not go away with this patch, as expected. However, it's a step in the right direction in case we do have multiple instances of the extension module alive at the same time in the future. Although then it would be interesting to consider how to find the actually correct module instance from internal functions.
History
Date User Action Args
2013年08月12日 13:55:27eli.benderskysetrecipients: + eli.bendersky, loewis, ncoghlan, pitrou, vstinner, christian.heimes
2013年08月12日 13:55:27eli.benderskysetmessageid: <1376315727.21.0.914891851376.issue18710@psf.upfronthosting.co.za>
2013年08月12日 13:55:27eli.benderskylinkissue18710 messages
2013年08月12日 13:55:27eli.benderskycreate

AltStyle によって変換されたページ (->オリジナル) /