Hey All,

In Jython 2.2.1, I could exent PyDictionary.java and supply my own Hashtable for the data representation,

doing something like this:

public class MyDictionary extends PyDictionary {
   final static private PyType dictType = new PyDictionary().getType();



   public MyDictionary () {
      super( dictType );// MyDictionary is actually a 'dict'
      super.table = makeCustomHashTable();
   }

   private Hashtable makeCustomHashTable( ) {
      // make a special Hashtable
   }
  
   // add model specific methods to manipulate the
   // hashtable that are only exposed in the Java API
   // (In Jython this class will look exactly like dict.
}

I noticed in Jython2.5 that the table field was made final, so it is no longer possible to do this.

How do I make a Java Object behave exactly like a python dict but have some other implementation of the
underlying data?

Thanks for any help here,

Zack



Windows Live™: Keep your life in sync. Check it out.