class DAL:
   def __init__(self,...,driver_args={})

so because this is defined in a module, every time driver_args is not
passed it is set to {}, the same {}. If one app changes, the default
changes for all apps. It is kind of counter intuitive but it works
that way.

It is very dangerous to set a default in a function to a list of
dictionary, because if somewhere downstream the object changed for one
instance, it changes the default for all future instances.

Massimo

On Mar 3, 5:12 pm, ron_m <ron.mco...@gmail.com> wrote:
> Wow that fixed it. You are a Python Ninja :-)
>
> I would sure like to know what the mechanism was that caused driver_args to
> bleed from SQLLite to the other adapters even though it is defaulted it to
> an empty dict on the class initializer. I also printed driver_args as the
> first line of code in DAL.__init__() and it had the value left over from
> SQLLite so how driver_args or {} produces {} when there is a value in
> driver_args.
>
> But you are very busy so if you don't have time no problem.

Reply via email to