Can someone explain why you need to delete the cursor objects and the iterator when you use for example:


I've checked the esri docs and there doesn't seem to be an explanation there, but the object is shown to be deleted at the end of both example scripts.


You need to delete the object in order to release any locks the UpdateCursor has taken out.

  • Yeah I just noticed that in the commented code. Cheers.
    – TheLastGIS
    Aug 6 '13 at 1:01
  • 3
    For those that are interested if you use the code: "with arcpy.UpdateCursor(blah) as cursor" this will 'guarantee close and release of database locks and reset iteration' as stipulated in the relevant ESRI documentation.
    – TheLastGIS
    Aug 6 '13 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.