Is it safe to remove google's "unused_argv" from forked python projects?
<p>On projects that google share on the web, they use:</p>

<p>def main(unused_argv):</p>

<p><a href="https://github.com/tensorflow/models/blob/master/im2txt/im2txt/train.py" rel="nofollow">(see example)</a>
, where <code>unused_argv</code> is never used. I couldn't find why do they do it and it annoys me to have warnings on my code.</p>

<p>Is it safe to remove this parameter?</p>

<p>Thanks</p>

<p>In that case it's presumably, because the tf.app.run function expects the main function to have a positional argument</p>

<p>This is the code that will call your main function: <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/platform/app.py" rel="nofollow">Source</a></p>

<pre><code>from tensorflow.python.platform import flags

def run(main=None):
  f = flags.FLAGS
  flags_passthrough = f._parse_flags()
  main = main or sys.modules['__main__'].main
sys.exit(main(sys.argv[:1] + flags_passthrough))
</code></pre>

python