code: def attrnum(self, attr):
          "Returns the number used for attr, which can be a name, or -n .. n-1."
          if attr < 0:
              return len(self.attrs) + attr
          elif isinstance(attr, str):
              return self.attrnames.index(attr)
          else:
              return attf attrnum(self, attr):
          "Returns the number used for attr, which can be a name, or -n .. n-1."
          if attr < 0:
              return len(self.attrs) + attr
          elif isinstance(attr, str):
              return self.attrnames.index(attr)
          else:
              return attr
docs: Returns the number used for attr, which can be a name, or -n .. n-1.