ToolValidator value.value,  out of date documentation -

Discussion created by lgtateos on Apr 25, 2014
Latest reply on May 11, 2014 by lgtateos
Hi All,

the ToolValidator documentation says:

As a Value object does not support string manipulation, use the Value object's value property whenever a string is to be manipulated or parsed. The code sample uses the os.path.dirname method to return the directory from a dataset.
if self.params[0].value:
  workspace = os.path.dirname(self.params[0].value.value)

However, the following works fine:
workspace = os.path.dirname(self.params[0].value)

My question are,

1. Has anyone encountered a situation where they DID have to use self.params[0].value.value and self.params[0].value wouldn't work?

2. Is this working because I'm running 10.2?  Does it work for those of you that have 9.3, 10.0, and 10.1? 

I have a dummy script tool with 1 param. The code below is for debugging outside the script tool.  It also works inside the script tool (I set a second param to that value to check it in the script tool). Here's a complete script to test this:

import arcpy, os

params = arcpy.GetParameterInfo("myScriptTool")
params[0].value = "C:/Temp/data.shp"

class ToolValidator:

  def __init__(self):
    import arcpy 
    self.params = arcpy.GetParameterInfo()

  def initializeParameters(self):
    # (initializeParameters code here)

  def updateParameters(self):
    # (updateParameters code here)
    print os.path.dirname(self.params[0].value)

  def updateMessages(self):
    # (updateMessages code here)

# Call routine(s) to debug
validator = ToolValidator()

It runs successfully and prints:

The documentation is about midway through the following page: