← Back to team overview

openerp-community team mailing list archive

Re: Coding Guidlines - long lines

 

On Fri, Nov 22, 2013 at 9:46 AM, Raphael Valyi <rvalyi@xxxxxxxxx> wrote:

> Guys [0],
>
> just a note of optimism (hey what else would you expect?):
> with the new API [1], it will be easier to write shorter lines:
> self.pool.get('ruby.rocks') -> self.pool['ruby.rocks'] (already available
> on v7 in fact)
> some_object.some_method(cr, uid, ids, *args, **kw) ->
> some_object.some_method(ids, *args, **kw)
>

and in fact when kw is the context, you will also be able to avoid writing
context=context to pass the last argument as it will be available
automatically [0]. So it's even better, finally some Ruby-like
meta-programming magic in that Python "explicit is better" world...

[0]
http://bazaar.launchpad.net/~openerp-dev/openobject-server/trunk-apiculture/view/head:/openerp/osv/orm.py#L3970


-- 
Raphaël Valyi
Founder and consultant
http://twitter.com/rvalyi <http://twitter.com/#!/rvalyi>
+55 21 2516 2954
www.akretion.com

Follow ups

References