title: Change property parameter from within class constructor [Python / Traits]
body: <p>I'm new to python - sorry if my terminology is wrong. I have a class which inherits the <a href="http://code.enthought.com/projects/files/ets_api/enthought.traits.has_traits.HasTraits.html" rel="noreferrer">Enthought Traits attributes</a>. Here is a simplified version:</p>
  
  <pre><code>from enthought.traits.api import HasTraits, Range
  from enthought.traits.ui.api import View, Item
  
  class GUIThing(HasTraits):
  
      my_slider = Range(0.0, 0.6, 0.1)
      my_slider._high = 0.7   # works; not what I need 'coz not instance-dependent
  
      view = View( Item('my_slider') )
  
      def __init__(self, arg1):
          # Call the parent's __init__
          HasTraits.__init__(self)
  
          self.my_slider._high = arg1  # what I need; doesn't work
  
  # -- Main program -----
  
  top_range = 0.9
  
  my_gui = GUIThing(top_range)
  my_gui.configure_traits()
  </code></pre>
  
  <p>This simply creates a window with a <a href="http://code.enthought.com/projects/files/ets_api/enthought.traits.traits.html#Range" rel="noreferrer">slider</a> in it, originally going from 0.0 to 0.6 with initial value 0.1. When creating an instance of GUIThing I want to vary the maximum value for the slider depending on the current <code>top_range</code> value. However the line</p>
  
  <p><code>self.my_slider._high = arg1</code></p>
  
  <p>results in</p>
  
  <p><code>AttributeError: 'float' object has no attribute '_high'</code></p>
  
  <p>When within <code>__init__()</code>, <code>self.my_slider</code> returns not the slider object, but the current value of the slider.</p>
  
  <p>What am I doing wrong? Thanks!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>The following also doesn't work:</p>
  
  <pre><code>class GUIThing(HasTraits):
  
      def __init__(self, arg1):
          # Call the parent's __init__
          HasTraits.__init__(self)
  
          self.my_slider = Range(0.0, arg1, 0.0)
  
      view = View( Item('my_slider') )
  </code></pre>
  
  <p>That would be the direct way to do what I'm trying to do, but it results in a GUI where instead of a slider, there is a text box that reads "enthought.traits.trait_types.Range object at 0xa61946c". So the problem is that when <code>my_slider</code> is created within <code>__init__()</code> then "my_slider" comes to mean the <em>object</em> itself (which doesn't display properly via View); but if <code>my_slider</code> is created outside of <code>__init__()</code> then "my_slider" comes to mean the <em>current value</em> (a float; which prevents access to the object properties).</p>
  
  <p>Not sure if this is peculiar to Traits or I just don't know how to initialise objects properly.</p>