scality / ScalitySproxydSwift

Scality sproxyd driver for OpenStack Swift
Apache License 2.0
5 stars 0 forks source link

Fix pep8: "do not assign a lambda expression, use a def" #182

Closed JordanP closed 8 years ago

JordanP commented 8 years ago

So be it.

NicolasT commented 8 years ago

Meh :-P

JordanP commented 8 years ago

Is that a +1 :) ?

NicolasT commented 8 years ago

It's So be it with a slight silent (grrr stupid rule) coming with it.

JordanP commented 8 years ago

Yeah, this rule is new. Because the failure is new. Anyway, easier to fix than to add another exception.

NicolasT commented 8 years ago

Could generalize as well:

def map_maybe(f, v):
    return f(v) if v is not None else None

class ...:
    def ...:
        self._conn_timeout = map_maybe(float, conf.get('sproxyd_conn_timeout'))
        self._read_timeout = map_maybe(float, conf.get('sproxyd_proxy_timeout'))

:grin:

JordanP commented 8 years ago

Call me maybe :musical_note: