← Back to team overview

openerp-community team mailing list archive

Re: context=None why?

 

Hi,

thanks, it was long time ago when i last read python specs. I completely
forget this one.

Thanks,
Csaba



2013.03.20. 19:26 keltezéssel, Bidoul, Stéphane írta:
> Hello,
> 
> See this, for instance.
> 
> http://stackoverflow.com/questions/5712904/empty-dictionary-as-default-value-for-keyword-argument-in-python-function-dicti
> 
> -sbi
> 
> Stéphane Bidoul
> Operations Director | Acsone sa/nv | http://acsone.eu/ <http://acsone.eu/>
> m +32 498 72 46 54 | t +32 2 888 3124 | f +32 2 888 3159
> 
> 
> On Wed, Mar 20, 2013 at 7:21 PM, Tóth Csaba <csaba.toth@xxxxxxxxxxxxxxxx
> <mailto:csaba.toth@xxxxxxxxxxxxxxxx>> wrote:
> 
>     Hi!
> 
>     I would like to ask why is the general use of context=None in the header
>     of methods? Why not context={} ?
>     In the second way we don't need to check all the time to be sure it is
>     an empty dict. And {} means False too, so i really don't understand
>     this.
> 
>     look this MP:
>     https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-posbox-bug-cbi/+merge/151747
> 
>     And i run into this problem a lot time during writing custom
>     functionalities!
> 
>     thanks,
>     Csaba
> 
>     _______________________________________________
>     Mailing list: https://launchpad.net/~openerp-community
>     Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
>     <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~openerp-community
>     More help   : https://help.launchpad.net/ListHelp
> 
> 


References