yola / yolapy

Yola API python client
MIT License
0 stars 0 forks source link

add **kwargs param to User.__init__ or replace explicit params with double splat? #73

Closed highflyingaction closed 7 years ago

highflyingaction commented 7 years ago

yolapy's User.__init__ expects lots of parameters but doesn't accept **kwargs.

This makes it very fragile if the userservice endpoints ever change what they return. For example, resetKey was recently removed from the UserPrivateSerializer.exclude list and that broke bottomline integration tests because yolapy just passes whatever the service returns to init

yolapy's Site, SiteImport, and Subscription models all only have a single **attrs style param for their __init__s so maybe there is some reason that User has explicit params that I'm just not thinking of.

What do we all think about adding **kwargs to yolapy's User.__init__ or just replacing all the named params with **kwargs? @yola/service-engineering

jslang commented 7 years ago

Apparently we accept the generalized kwargs for update operations. No reason we couldn't do that for init too, as far as I can tell. I definitely vote for us doing what we do with the other models.

blaix commented 7 years ago

I'm guessing it was a sentiment along the lines of explicit is better than implicit, but **kwargs has been working well in our other client models so I'm all for doing it here too.