title: Is it un-pythonic to define a function inside of a class method?
body: <p>PyLint told me that one of my class methods didn't need to be a method, but could just be a function in a class since it didn't use any class attribute. That made me do things I thought were "bad," but maybe they are  Pythonic. Is the following code what Python wants us to do?</p>
  
  <pre><code>class TestClass(ParentClass):
      def __init__(self):
          def callbackfunction(text):
              print("hello")
          ParentClass.map_event_to_callback(ParentClass.event, callbackfunction)
  </code></pre>
  
  <p>where ParentClass.event emits <code>text</code> to its callback, but we'll just ignore that print <code>"hello"</code> instead. Even simpler:</p>
  
  <pre><code>class TestClass():
      def __init__(self, text):
          def printhello(text):
              print("hello")
          printhello(text)
  </code></pre>
  
  <p>assuming I don't care about <code>text</code> or <code>printhello</code> after <code>__init__</code>.</p>