<?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 Better type hinting for arcpy.env in Python Ideas</title>
    <link>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idi-p/1508867</link>
    <description>&lt;P&gt;I pretty frequently find myself using tons of magic strings and flip flopping of environment variables in my scripts.&lt;/P&gt;&lt;P&gt;I have implemented something that does this as best as I can &lt;A href="https://github.com/hwelch-fle/pytframe2/blob/main/utils/environment.py" target="_self"&gt;here&lt;/A&gt;&amp;nbsp; as an example solution. It's essentially a carbon copy of the EnvManager class but with explicitly defined environments so a static type checker can help you make sure you're feeding correct values and parameters to the GPEnvironment object.&lt;/P&gt;&lt;P&gt;This could also be implemented in a .pyi file for EnvManager.py to allow for forwards compatibility with changes to env parameters and type hinting updates could lag behind without causing issues.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HaydenWelch_0-1721764967861.png" style="width: 741px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110420i9D558B95B4E1D8FE/image-dimensions/741x287?v=v2" width="741" height="287" role="button" title="HaydenWelch_0-1721764967861.png" alt="HaydenWelch_0-1721764967861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2024 12:35:19 GMT</pubDate>
    <dc:creator>HaydenWelch</dc:creator>
    <dc:date>2024-07-24T12:35:19Z</dc:date>
    <item>
      <title>Better type hinting for arcpy.env</title>
      <link>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idi-p/1508867</link>
      <description>&lt;P&gt;I pretty frequently find myself using tons of magic strings and flip flopping of environment variables in my scripts.&lt;/P&gt;&lt;P&gt;I have implemented something that does this as best as I can &lt;A href="https://github.com/hwelch-fle/pytframe2/blob/main/utils/environment.py" target="_self"&gt;here&lt;/A&gt;&amp;nbsp; as an example solution. It's essentially a carbon copy of the EnvManager class but with explicitly defined environments so a static type checker can help you make sure you're feeding correct values and parameters to the GPEnvironment object.&lt;/P&gt;&lt;P&gt;This could also be implemented in a .pyi file for EnvManager.py to allow for forwards compatibility with changes to env parameters and type hinting updates could lag behind without causing issues.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HaydenWelch_0-1721764967861.png" style="width: 741px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110420i9D558B95B4E1D8FE/image-dimensions/741x287?v=v2" width="741" height="287" role="button" title="HaydenWelch_0-1721764967861.png" alt="HaydenWelch_0-1721764967861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 12:35:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idi-p/1508867</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2024-07-24T12:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: A context manager for arcpy.env</title>
      <link>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1508878#M344</link>
      <description>&lt;P&gt;ArcPy already has a full-blown context manager for managing geoprocessing environments:&amp;nbsp; &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/envmanager.htm" target="_blank"&gt;EnvManager—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 20:35:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1508878#M344</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-07-23T20:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: A context manager for arcpy.env</title>
      <link>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1508904#M345</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1371"&gt;@JoshuaBixby&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I'm dumb. At least this is still useful for the type hinting and auto completion/literals lol.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Updated the title to reflect that.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 21:18:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1508904#M345</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2024-07-23T21:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Better type hinting for arcpy.env - Status changed to: In Product Plan</title>
      <link>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1512458#M347</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We're working on this!&amp;nbsp; This status does not guarantee that the functionality will be in the next release, but development work has begun. Release cycles vary by product so make sure to check&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://support.esri.com/en/other-resources/product-life-cycle" target="_blank" rel="noopener nofollow noreferrer"&gt;&lt;SPAN&gt;product&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;life cycle information&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;to get an idea of when to expect the next release.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 16:52:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1512458#M347</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2024-07-30T16:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Better type hinting for arcpy.env - Status changed to: Implemented</title>
      <link>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1556853#M384</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This idea has been implemented in ArcGIS Pro 3.4, please see&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/get-started/whats-new-in-arcgis-pro.htm#ESRI_SECTION1_AB3F982B6A174B74AFF373A90D77CA20" target="_self" rel="nofollow noopener noreferrer"&gt;the Python section of the What's New in ArcGIS Pro 3.4 topic&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;and scroll to ArcPy.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL id="UL_B47FE8752BC04909ADBE1CAEB64A61FA"&gt;
&lt;LI id="LI_0EEA88C47E434365A44B69594A630D96"&gt;Improvements were made to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="xref xref" href="https://pro.arcgis.com/en/pro-app/3.4/arcpy/classes/alphabetical-list-of-arcpy-classes.htm" target="_blank"&gt;type hints&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="usertext"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="usertext"&gt;arcpy.da&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="usertext"&gt;arcpy.charts&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;modules. Type hints were added to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="ph"&gt;ArcPy&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;classes and geoprocessing tools including&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="usertext"&gt;&lt;A class="xref xref" href="https://pro.arcgis.com/en/pro-app/3.4/arcpy/classes/result.htm" target="_blank"&gt;Result&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="usertext"&gt;&lt;A class="xref xref" href="https://pro.arcgis.com/en/pro-app/3.4/arcpy/classes/raster-object.htm" target="_blank"&gt;Raster&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;objects. Type hints provide an improved code authoring experience in modern integrated development environments (IDEs).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;We have been gradually adding type hints to ArcPy, including EnvManager, and continue to progress these.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 16:37:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-ideas/better-type-hinting-for-arcpy-env/idc-p/1556853#M384</guid>
      <dc:creator>HannesZiegler</dc:creator>
      <dc:date>2024-11-08T16:37:49Z</dc:date>
    </item>
  </channel>
</rss>

