coding style - python styling ** question -
i'm working on first project using python 2.7. we're coming java background , our first instinct write python code in java-esque way. we're trying adapt as possible. far using pylint adapt our code.
now keep running situation pylint. every time use **data pass values method i'm getting pylint warning using * or **. question is: using ** bad styling writing python code? there kind of standard replacement using ?
regards, bogdan
** can introduce more tricky bug because accept anything. want code breaks when called wrong. here example:
def dostuff(**kwargs): force = 3 if kwargs.get('reallyhard', false): force += 5 # , on # need luck find bug ... dostuff(fancy=true, funky=false, realyhard=true) you shouldn't use ** because lazy type out argument names. not possible though, there legitimate uses too.
Comments
Post a Comment