The problem with this model is that it requires you to subclass and use a special type. My goal is to enable simple usage in binding scenarios:
 
_list.ItemsSource = range(5)
 
This means that every list/dictionary/touple needs to support ICustomTypeDescriptor and GetHashCode/SyncRoot... The ICD requirement for object/dict is pretty solid, but I'll follow up with our databinding team to see if we can gracefully support non-hash supporting objects...
 
I'm unclear as to why returning the default CLR implementation of GetHashCode would be bad? It's unique to the life of the object and never changes... it won't be based on the containing data in the list, but it also shouldn't break any hashtable... no?


 
On 5/12/05, Timothy Fitz <[EMAIL PROTECTED]> wrote:
Not directly, but subclassing list and dict would work.

class HashableList:
def __hash__(self):
   return id(self)

or

clash HashableList:
def __hash__(self):
   return 1

To adapt simply:

HashableList(MyExistingList)

Disclaimer, I'm not sure if this works in IronPython today.

_______________________________________________
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to