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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -