<?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>idea Geoprocessing array: Directly iterate over items in a container in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/geoprocessing-array-directly-iterate-over-items-in/idi-p/1146763</link>
    <description>&lt;P&gt;The answer in this post describes it best:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcmap-questions/why-does-quot-for-point-in-part-quot-work-in-a/m-p/1146351#M3466" target="_self"&gt;Why does "for point in part:" work in a standalone ArcPy script, but not in the Field Calculator?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The difference in behavior is due to the fact that objects within geoprocessing tools are not the same as objects within ArcPy. The pattern of directly iterating over items in a container, &lt;FONT face="courier new,courier"&gt;for point in part:&lt;/FONT&gt;, is a Python use pattern that is implemented in most ArcPy classes but not in ArcObjects classes being used by geoprocessing tools.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The geoprocessing&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;array&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;does not implement the &lt;FONT face="courier new,courier"&gt;__iter__&lt;/FONT&gt; special method while ArcPy&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Array&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;does implement it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Idea:&lt;BR /&gt;&lt;BR /&gt;Could ESRI please enhance the geoprocessing array so that we can directly iterate over items in a container?&lt;BR /&gt;Examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;for&amp;nbsp;part in geometry:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;for point in part:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Feb 2022 13:33:27 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-02-23T13:33:27Z</dc:date>
    <item>
      <title>Geoprocessing array: Directly iterate over items in a container</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/geoprocessing-array-directly-iterate-over-items-in/idi-p/1146763</link>
      <description>&lt;P&gt;The answer in this post describes it best:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcmap-questions/why-does-quot-for-point-in-part-quot-work-in-a/m-p/1146351#M3466" target="_self"&gt;Why does "for point in part:" work in a standalone ArcPy script, but not in the Field Calculator?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The difference in behavior is due to the fact that objects within geoprocessing tools are not the same as objects within ArcPy. The pattern of directly iterating over items in a container, &lt;FONT face="courier new,courier"&gt;for point in part:&lt;/FONT&gt;, is a Python use pattern that is implemented in most ArcPy classes but not in ArcObjects classes being used by geoprocessing tools.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;The geoprocessing&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;array&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;does not implement the &lt;FONT face="courier new,courier"&gt;__iter__&lt;/FONT&gt; special method while ArcPy&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Array&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;does implement it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Idea:&lt;BR /&gt;&lt;BR /&gt;Could ESRI please enhance the geoprocessing array so that we can directly iterate over items in a container?&lt;BR /&gt;Examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;for&amp;nbsp;part in geometry:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;for point in part:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 13:33:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/geoprocessing-array-directly-iterate-over-items-in/idi-p/1146763</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-02-23T13:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Enhance the geoprocessing array: Directly iterate over items in a container</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/geoprocessing-array-directly-iterate-over-items-in/idc-p/1146791#M18776</link>
      <description>&lt;P&gt;yes! or just read arrays directly&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 00:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/geoprocessing-array-directly-iterate-over-items-in/idc-p/1146791#M18776</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-02-23T00:47:36Z</dc:date>
    </item>
  </channel>
</rss>

