[Python-Dev] FileCookieJars
Steven D'Aprano
steve at pearwood.info
Sat Mar 9 02:13:54 CET 2013
On 02/03/13 02:43, Demian Brecht wrote:
> Cross-posting from python-ideas due to no response there. Perhaps it's
> due to a general lack of usage/caring for cookiejar, but figured
> /someone/'s got to have an opinion about my proposal ;)
Apparently not :-(
> TL;DR: CookieJar > FileCookieJar > *CookieJar are architecturally
> broken and this is an attempt to rectify that (and fix a couple bugs
> along the way).
[...]
> This will obviously break backwards compatibility, so I'm not entirely
> sure what best practice is around that: leave well enough alone even
> though it might not make sense, keep the old implementations around
> and deprecate them to be eventually replaced by the processors, or
> other ideas?
I don't have an opinion on cookiejars per se, but I think that the first
thing to do is get an idea of just how major a backward-compatibility
breakage this would be. If you change the cookiejar architecture, then
run the Python test suite, what happens? The number of failures will give
you an idea of how bad it will be.
If there are no failures, you could consider just making the change. You
probably should make an attempt to find out what third party apps use the
cookiejars and see what they do.
If there are failures, then you need to add a second cookiejar
implementation, and deprecate the old one.
Oh, and please don't call the new cookier jar anything like "NewCookieJar".
Because in a few years, it won't be.
Actually, I lied, I do have an opinion on cookiejars. I agree with Terry
that it is a bit weird to have an ABC inherit from a concrete class. Not
just weird, but a violation of the Liskov Substitution Principle that
an instance of a subclass should be usable anywhere an instance of the
parent class is. If you can't even instantiate the subclass, that's a
pretty major violation for no apparent benefit :-)
--
Steven
More information about the Python-Dev
mailing list