bixb0012

Blank Help with Interactive Python Window

Discussion created by bixb0012 Champion on May 28, 2015
Latest reply on Jun 4, 2015 by bixb0012

While interactively scripting in ArcGIS Desktop, I always noticed but couldn't figure out why most Python functions and methods would show something in the Python Help Window but not all functions and methods.  At first, I thought some functions and methods lacked docstrings, which would cause the Help Window to be blank, but I often found those functions and methods actually had docstrings.  It was a mystery but not one worth wasting time on.  Serendipitously, I stumbled into the answer while sorting something else out this week.

 

It turns out, the interactive Python Window doesn't properly show the __doc__ special attribute in the Help Window for Python classes or functions/methods within classes.  For example, let's look at arcpy.FromWKT:

arcgis_python_window_fromwkt_help.PNG

You can see that ArcGIS Desktop is displaying the __doc__ special attribute in the Python Help Window.  Now let's look at arcpy.Polygon:

arcgis_python_window_polygon_help.PNG

Although the __doc__ special attribute isn't overly verbose or detailed like with arcpy.FromWKT, there is nothing being displayed in the Python Help Window.  For the longest time, I couldn't figure out what differentiated the former from the latter.  The answer, Python classes.  arcpy.FromWKT is a function defined at the module level whereas arcpy.Polygon is a class.  Furthermore, for functions/methods defined within a class, the __doc__ special attribute isn't displayed either.

 

For ArcPy itself, the impact is noticeable, but whether it is significant or not is debatable.  The real issue arises because the interactive Python Window doesn't behave this way just for ArcPy but for all Python packages.  For example, look at the multiprocessing module:

arcgis_python_window_pool_help.PNG

For some Python packages, this bug/oversight has minimal impact, but there are other Python packages where a significant amount of useful documentation doesn't show up in the Python Help Window.

Outcomes