I have the defined the following class as:
def user_kitchen(handle):
    # return a BeautifulSoup object
class User(object):
    def __init__(self, handle):
        self.handle = str(handle)
        self.soup = user_kitchen(handle)
        self.details = self.find_details()
    def find_details(self):
        value_map = {}
        for detail, attribute in details_map:
            value = (self.soup).find_all(attrs=attribute)[0].text
            value_map[detail] = value
        return value_map
When I instantiate the class User as:
me = User('torvalds')
I am getting a NameError: name 'self' is not defined
Here is the traceback:
In []: me = User('torvalds')
NameError                         Traceback (most recent call last)
<ipython-input-61-f6d334f2ee24> in <module>()
----> 1 me = User('torvalds')
/home/user.py in __init__(self, handle)
     28         value_map = {}
     29         for detail, attribute in details_map:
---> 30             value = (self.soup).find_all(attrs=attribute)[0].text
     31             value_map[detail] = value
     32         return value_map
/home/user.py in _find_details(detail)
     18 
     19 
---> 20 class User(object):
     21 
     22     def __init__(self, handle):
NameError: name 'self' is not defined
I have looked at few similar questions on SO about calling instance methods from __init__ method: 
Yet I am unable to fix this.
 
     
    