Author vstinner
Recipients ezio.melotti, lemburg, vstinner
Date 2020-09-23.14:49:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600872594.55.0.261984022225.issue41842@roundup.psfhosted.org>
In-reply-to
Content
> Just found an internal API which already takes care of
> unregistering a search function: _PyCodec_Forget().
>
> All that needs to be done is to expose this as codecs.unregister()
> and add the clearing of the lookup cache.

Yeah, I saw this function, but it's related to the cache, not to the list of search functions.


> BTW: While you're at it, having a way to access the search function
> list from Python would be nice as well, since this would then open
> up the possibility to reorder search functions.

I didn't hear anyone (ok, apart you) who requested to order search functions.

I dislike the idea of exposing it, since it introduces the risk that someone "unregisters" a search function simply by removing it from the list, without invalidating the cache.

I prefer to hide the internals to ensure that the cache remains consistent.
History
Date User Action Args
2020-09-23 14:49:54vstinnersetrecipients: + vstinner, lemburg, ezio.melotti
2020-09-23 14:49:54vstinnersetmessageid: <1600872594.55.0.261984022225.issue41842@roundup.psfhosted.org>
2020-09-23 14:49:54vstinnerlinkissue41842 messages
2020-09-23 14:49:54vstinnercreate