title: naming conventions to differentiate a function (action) from a variable (option) in python
body: <p>Often I'll have little functions that do something. e.g. save_csv(), show_plot(), and then larger functions which do a bunch of stuff and optionally call the little functions. What's a decent naming convention for this to differentiate e.g. <code>save_csv()</code> as a function, and <code>save_csv</code> as a flag?
  In C etc it's not unusual to use Hungarian notation and prefix the variables with a 'b' for 'boolean'. But I don't think that's very pythonic. And I've tried 'do_' prefix for the flag and it kind of works but is ugly and confusing too. I'm wondering if there's any conventions for this?</p>
  
  <p>I couldn't see anything in pep8. 
  <a href="https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles" rel="nofollow noreferrer">https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles</a></p>
  
  <p>e.g. </p>
  
  <pre><code>def foo(..., b_resample, b_save_csv, b_save_plot, b_show_plot, b_compare):
  
      # do some stuff
  
      if b_resample:
          # do more stuff
          resample(...)
  
      if b_show_plot:
          # do more stuff
          show_plot(...)
  
      if b_compare:
          # do more stuff
          compare(...)
  
      # do more stuff
  
      if b_save_csv:
          # do more stuff
          save_csv(...)
  </code></pre>
  
  <p>UPDATE:
  Bearing in mind that the arguments to the function are public facing, I'd like them to be 'decent' which is why I'm not a fan of hungarian notation  or leading underscores in this case. However I am considering switching to the below, where the public facing args are human readable, whereas internally they have leading underscores. Is this common practice? </p>
  
  <pre><code>def foo(..., **kwargs):
      _resample = kwargs.get('resample', False)
      _show_plot = kwargs.get('show_plot', False)
      _save_plot = kwargs.get('save_plot', True)
      _compare = kwargs.get('compare', True)
      _save_csv = kwargs.get('save_csv', True)
  
      # do some stuff
  
      if _resample:
          # do more stuff
          resample(...)
  
      if _show_plot:
          # do more stuff
          show_plot(...)
  
      if _compare:
          # do more stuff
          compare(...)
  
      # do more stuff
  
      if _save_csv:
          # do more stuff
          save_csv(...)
  </code></pre>