Comment 34 for bug 525808

Revision history for this message
Numérigraphe (numerigraphe) wrote : Re: [Bug 525808] Re: Default values should be immutable

Le 06/03/2012 10:26, Niels Huylebroeck a écrit :
> This depends on whether or not the called function wants to alter the behavior (...) of the calling function and thus seems optional and depends on the case.
Ghostbusters don't cross the streams, though it depends on the case too.
Usually in OpenERP the context is updated to adjust the behavior of
subsequent function calls, not that of the caller.
For example, there's no reason to mutate the context in an ORM method is
there?
Furthermore, there is no way a developer can know the impact of changing
a key in the caller's context, so at first sight I'd consider it a mistake.
Legitimate uses are possible but they would be rare, wouldn't they? They
should be explicitly documented with a comment.
> I'd just like to point out that the context is not passed with a "pointer" or anything like that(...)
Sorry about the C-ish description. The important part was : it's mutable.

Lionel.