<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: arcpy.da.SearcherCursor() as Cursor or as Row in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759481#M58602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to debug code that contains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;with arcpy.da.SearchCursor(featureclassname, featureclassfieldnames) as antidisestablishmentarianisms:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp; &amp;nbsp; for&amp;nbsp;antidisestablishmentarianism in antidisestablishmentarianisms:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;blah&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;- V&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Sep 2017 17:21:59 GMT</pubDate>
    <dc:creator>VinceAngelo</dc:creator>
    <dc:date>2017-09-11T17:21:59Z</dc:date>
    <item>
      <title>arcpy.da.SearcherCursor() as Cursor or as Row</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759476#M58597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the difference in declaring a search cursor as a cursor or a row? &amp;nbsp;Is it just a style/personal thing or is there a difference in functionality? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;A href="https://community.esri.com/thread/201367"&gt;Adding to a Selection&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3355"&gt;Curtis Price&lt;/A&gt;‌ uses as &lt;STRONG&gt;row &lt;/STRONG&gt;in his solution for me, in&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/searchcursor-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/searchcursor-class.htm"&gt;SearchCursor—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;as &lt;STRONG&gt;cursor&lt;/STRONG&gt; is used. There seems to be a slight syntax difference used between the two when accessing the information in the cursor itself:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor("apLayer", "FullStreet") as rows:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; streets = [row[0] for row in rows] &amp;nbsp; .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;versus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: blue;"&gt;with&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;da&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;SearchCursor&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;fc&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;fields&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: blue;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;cursor&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: blue;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;for&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;row&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: blue;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;cursor&lt;/SPAN&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;blah blah blah blah.......&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #4d4d4d;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 19:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759476#M58597</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2017-09-08T19:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.SearcherCursor() as Cursor or as Row</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759477#M58598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both are valid. The first is just a naming preference for working with list comprehensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the absence of thorough documentation, a coherent naming policy can self-document many a script. There often times when a code cascade raises conflicts with standard naming, at which point you need to do the best you can. Remember: &lt;A href="https://en.wikiquote.org/wiki/Andrew_S._Tanenbaum"&gt;The nice thing about standards is that you have so many to choose from.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 19:37:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759477#M58598</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2017-09-08T19:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.SearcherCursor() as Cursor or as Row</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759478#M58599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep... &amp;nbsp;Words to (I) live by....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2017 20:01:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759478#M58599</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2017-09-08T20:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.SearcherCursor() as Cursor or as Row</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759479#M58600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the Python aspect of your question, both of your examples use the &lt;A href="https://docs.python.org/2/reference/compound_stmts.html#the-with-statement" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;with&lt;/SPAN&gt; &lt;/A&gt;statement:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="text-align: justify; line-height: 20.8px; color: #000000; font-family: sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://docs.python.org/2/reference/compound_stmts.html#with" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;with&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement is used to wrap the execution of a block with methods defined by a context manager (see section&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://docs.python.org/2/reference/datamodel.html#context-managers" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;SPAN class=""&gt;With Statement Context Managers&lt;/SPAN&gt;&lt;/A&gt;). This allows common&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://docs.python.org/2/reference/compound_stmts.html#try" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;try&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;…&lt;A class="" href="https://docs.python.org/2/reference/compound_stmts.html#except" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;except&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;…&lt;A class="" href="https://docs.python.org/2/reference/compound_stmts.html#finally" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;finally&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;usage patterns to be encapsulated for convenient reuse.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;with_stmt&lt;/STRONG&gt; ::=&amp;nbsp; “with” with_item (“,” with_item)* “:” &lt;A class="" href="https://docs.python.org/2/reference/compound_stmts.html#grammar-token-suite" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;suite
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;&lt;STRONG&gt;with_item&lt;/STRONG&gt; ::=&amp;nbsp; &lt;A class="" href="https://docs.python.org/2/reference/expressions.html#grammar-token-expression" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;expression&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt; [“as” &lt;A class="" href="https://docs.python.org/2/reference/simple_stmts.html#grammar-token-target" style="color: #355f7c; text-decoration: none;" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;target&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/A&gt;]&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The part after &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;as&lt;/SPAN&gt;, whether called "rows" or "cursor," it just a label/name for the target object, and that label/name carries no meaning in and of itself.&amp;nbsp; You could write, &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;with arcpy.da.SearchCursor() as elephant:,&lt;/SPAN&gt; and it wouldn't matter; but it might confuse someone reading the code what a cursor has to do with elephants.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The part of the code after the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;with&lt;/SPAN&gt; statement in your examples, the &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;suite&lt;/SPAN&gt; as the documentation refers to it, doesn't depend on whether someone used "rows" or "cursors," they are just names.&amp;nbsp; For example, one doesn't have to use "rows" to use a list comprehension in the suite, list comprehensions could be used with whatever named was chosen for the target object of the context manager.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759479#M58600</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-12T08:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.SearcherCursor() as Cursor or as Row</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759480#M58601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Josua!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/bixb0012"&gt;bixb0012&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Sep 2017 13:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759480#M58601</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2017-09-09T13:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.da.SearcherCursor() as Cursor or as Row</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759481#M58602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to debug code that contains:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;with arcpy.da.SearchCursor(featureclassname, featureclassfieldnames) as antidisestablishmentarianisms:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp; &amp;nbsp; for&amp;nbsp;antidisestablishmentarianism in antidisestablishmentarianisms:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;blah&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;- V&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 17:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-da-searchercursor-as-cursor-or-as-row/m-p/759481#M58602</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2017-09-11T17:21:59Z</dc:date>
    </item>
  </channel>
</rss>

