title: Pythonic way for static function variables (small scope, single initialization)?
body: <pre><code>def clean_word(word):
      chars_to_clean = {',', ':', '.','/'} #static?
      res = ''
      for c in word:
          if c not in chars_to_clean:
              res += c
      return res
  </code></pre>
  
  <p>In C++ I would have declared <code>chars_to_clean</code> as <code>static</code> so that I can minimize its scope on one hand and avoid repeated assignment on the other. How can I achieve these goals in Python?</p>
  
  <p>I could make <code>chars_to_clean</code> a class variable, but I'd like to reduce the scope as much as possible.<br>
  I could make it a function's attribute, but I suspect the assignment is repeated in every call.</p>