In a script I have designed a function that is used multiple times on different search cursors to search through a whole table.
p - a list of points: actually a list of two-element lists with point coordinates, e.g. [[4710000.0, 3300000.0], [4715000.0, 3305000.0], [4710000.0, 3310000.0], [4705000.0, 3305000.0], [4715000.0, 3300000.0], [4715000.0, 3310000.0], [4705000.0, 3310000.0], [4705000.0, 3300000.0]]
c - a SearchCursor on a table with point coordinates
The function is supposed to search through the table with a cursor and return a list of points from the table that are also on the "p" list.
def ptsrch(p,c): list =  for i in c: currpt = [i.getValue("X_GRID"),i.getValue("Y_GRID")] if currpt in p: list.append(currpt) c.reset() return list
It works fine on the first use of each SearchCursor. Even though at the end of the function the cursor is supposed to reset, it doesn't.
In ArcGIS 10 Desktop help reset() is listed as a method: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v00000068000000
I found a worrying post from 2008 on ESRI Forums: http://forums.esri.com/Thread.asp?c=93&f=1729&t=250536
in which it is stated that "As far as I know, the Reset Method has never worked. I was told 2-3 years ago that it would be operational in a "future release". Apparently that time hasn't come yet!"
That one though refers to ArcGIS 9.3 or earlier.
I have also found a blog post: https://omniolocalia.wordpress.com/tag/arcpy-da-searchcursor/ which praises the possibility to reset cursors in ArcGIS 10.1, mentioning that it was previously impossible.
So, has anyone encountered a similar problem?
Instead of a SearchCursor I can of course load all tables to Python lists and keep them in memory, though I'm afraid of a memory overload - the total number of rows in these tables will be almost 400000 (right now I'm testing on a small chunk of data, so the total number of rows is 500).