title: Getting "TypeError: method takes 0 positional arguments but 1 was given" with "self" as argument
body: <p>I am trying to store each line of a txt file in a list. Getting the error mentioned in the title even though my methods contain self as an argument. Here's my codes:</p>
  <p>This is corpus.py</p>
  <pre><code>class Corpus():
  
  def __init__(self, corpus_name):
      self.corpus_name = corpus_name
  
  def corpus_to_list(self):
      corpus = open(self.corpus_name, &quot;r&quot;)
      my_corpus = corpus.split(&quot;\n&quot;)
      corpus.close()
      
      return my_corpus
  </code></pre>
  <p>and this is main.py</p>
  <pre><code>import corpus as corp
  
  def main():
      corpus = corp.Corpus(&quot;review.txt&quot;)
      corpus_list = corpus.corpus_to_list()
      print(corpus_list)
  
  if __name__ == &quot;__main__&quot;:
      main()
  </code></pre>