On Wednesday 10 September 2008, Oleg Broytmann wrote:
> On Wed, Sep 10, 2008 at 03:57:45PM +0300, Dan Pascu wrote:
> > On Wednesday 10 September 2008, Oleg Broytmann wrote:
> > > > The second fix is for incorrectly interpretted boolean values
> > > > passed via arguments to connectionForURI or via dburi parameters.
> > >
> > >    Why Boolean is a class and not just a function? It never creates
> > > any instance of the class.
> >
> > No particular reason. I guess it comes from the habit of doing it
> > that way because it looks more like a data type with a class. Of
> > course a function would do just fine, but there is no big difference
> > since with the class the __new__ method will do exactly what that
> > function would do.
>
>    Ok, then. I don't care about it too much.
>
>    What I care is the following. If I release 0.9.8 and 0.10.3 the
> meaning for URLs like '...?debug=0' would be different compared to
> previous versions,

That is true, but only because debug=0 was interpretted the wrong way.
OTOH, I do not assume anyone used debug=0 to indicate debug=False, because 
they would quickly find out that it actually still means True, like 
debug=1, so we should have seen bug reports about it. For the debug 
parameter, people mostly enable it using debug=1, since it is disabled by 
default, so the debug=0 was just an example, not something I expect 
people to actually use.

I didn't run into this problem until now, when I had to disable the cache 
at the connection level (since the cache, as opposed to the debug flags, 
is enabled by default). Then I found out that ?cache=0 didn't work. 
What's even worse, connectionForURI(uri, cache=False) didn't work either.
Then I inspected the code and find out that the only way to do it is 
using '?cache=' which is awkward.

> so if a developer debugs a program against the newer 
> version of SQLObject and deploy against an older version this could
> lead to subtle bugs. Isn't it a problem? 

It may be, but apparently none used these cases until now, else they would 
have reported the problem.

> The patch is not a bugfix but a small feature, isn't it?

Here I disagree. The way the arguments are interpreted is wrong, which 
means it is a bug. You can say that interpretting the new boolean 
keywords (yes/no, on/off, ...) is a feature, but debug=0 meaning True is 
simply wrong. Even worse, connectionForURI(uri, cache=False) keeping the 
cache enabled was unacceptable, because it was simply confusing IMO.

> Should we allow such changes of the API? 
>    Python core developers would disallow such features - even small
> features - but they are working on a project with much bigger scale.
> But for SQLObject, and counting that the change is only about less
> significant part of the DB URI API - I think it's mostly ok.

IMO, if somebody hits such an incompatibility case they can easily recover 
from it by using the empty value parameter to indicate False, which still 
works the same in all versions. That's why I left it in there, to 
preserve compatibility with existing code.

I think the advantages of having the fix exceed the disadvantages you 
mention.

-- 
Dan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to