arcpy.CalculateStatistics_management("demExtract","1","1","#","OVERWRITE")
arcpy.CalculateStatistics_management((os.path.join(gdbPath, "demExtract")),"1","1","#","OVERWRITE")
Shouldn't:
arcpy.CalculateStatistics_management("demExtract"),"1","1","#","OVERWRITE")
be
arcpy.CalculateStatistics_management("demExtract","1","1","#","OVERWRITE")
Looks like Python code written by Esri uses underscores, for example look in:
C:\Program Files (x86)\ArcGIS\Desktop10.4\arcpy\arcpy\sa\Functions.py
However many of the examples written by Esri in the arcpy reference use camelCase, but I've seen instances where they are inconsistent.
Python style guide says lower_with_under
PEP 8 -- Style Guide for Python Code | Python.org
Google style guide says lower_with_under
The key is, ... it is a guide ... not rules .... can't find the exact link, but even Python's BDFL said as much
Yes typically I would recommend getting used to PEP8 style, it is used for the majority of Python projects and is something that is appreciated during coding interviews ArcPy actually breaks PEP8 in a lot of places for a number of historical reasons, so its not the best reference for the canonical Python style.
Edit: Late to the party. Oh well.
The biggest danger of using local path names I have run into is that they can conflict with layer names in your map. If you have a dataset named "foo" in your workspace and a layer named "foo" in your map (or in memory), the layer will be used. Took me a while to figure that one out.