code: def asDictionary(self):
          
          value = self._dict
          if value is None:
              template = {
                  "hasM" : self._hasM,
                  "hasZ" : self._hasZ,
                  "paths" : [],
                  "spatialReference" : self.spatialReference
              }
              for part in self._paths:
                  lpart = []
                  for pt in part:
                      lpart.append(pt.asList)
                  template['paths'].append(lpart)
                  del lpart
              self._dict = template
          return self._dict
docs: returns the object as a python dictionary