This is probably better as:

     attrlist = kw.get('attrlist')
     if attrlist is not None:
         attrlist = tuple(sorted(attrlist))

     cache_key = ( ....
       attrlist
      )

If only because there needn't be a requirement that attrlist be an actual list instance (e.g. if it's already a tuple).