<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getftype(self, name):
 """Returns the python type for the specified field name. The field list is cached so multiple calls do not invoke a getFields request each time. @param name(string) The name of the SOLR field @returns Python type of the field. """

        fields = self.getFields()
        try:
            fld = fields['fields'][name]
        except Exception:
            return str
        if fld['type'] in ['string', 'text', 'stext', 'text_ws']:
            return str
        if fld['type'] in ['sint', 'integer', 'long', 'slong']:
            return int
        if fld['type'] in ['sdouble', 'double', 'sfloat', 'float']:
            return float
        if fld['type'] in ['boolean']:
            return bool
        return fld['type']