title: How to avoid using self in Python class methods?
body: <p>I am trying to implement a LinkedList in Python and below is the code I have written for the same.</p>
  <pre><code>from linkedlists.Node import Node
  
  
  class LinkedList:
      def __init__(self):
          self.head = None
  
      def insert_at_beginning(self, data):
          temp = Node(data)
          if self.head is None:
              self.head = temp
          else:
              temp.next = self.head
              self.head = temp
  
      def insert_at_end(self, data):
          temp = Node(data)
          if self.head is None:
              self.head = temp
          else:
              curr = self.head
              while curr.next is not None:
                  curr = curr.next
              curr.next = temp
  
      def insert_at_position(self, pos, data):
          temp = Node(data)
          if self.head is None:
              self.head = temp
          else:
              curr = self.head
              i = 1
              while i &lt; pos:
                  curr = curr.next
                  i += 1
              temp.next = curr.next
              curr.next = temp
  
      def traverse_list(self):
          if self.head is None:
              print('List is empty')
          else:
              curr = self.head
              while curr.next is not None:
                  print(curr.data)
                  curr = curr.next
  
  
  if __name__ == '__main__':
      ll = LinkedList
      ll.head = Node(1)
      ll.insert_at_beginning(10)
      ll.traverse_list()
  </code></pre>
  <p>When I run the code, I see the run time exception:</p>
  <pre><code>TypeError: insert_at_beginning() missing 1 required positional argument: 'self'
  </code></pre>
  <p>Thats because I have a method parameter <code>self</code> in the method definition.
  I can't remove the <code>self</code> parameter because I am initializing the head to <code>self</code> in the constructor.</p>
  <p>Is there anyway I can call the methods without <code>self</code> or if I can construct all of my logic without using <code>self</code> ?
  Any help is appreciated.</p>