RE: Re: Mutable Bytes
"Mark Hahn" <[email protected]> Fri, 30 Jul 2004 10:22:56 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <000601c47659$da8babd0$0b01a8c0@mark> |
Greg Ewing wrote: >> I understand. The list, for example, can be checked for >> equality and >> yet it is dependent on other objects. >> Do you think I should just pull >> the immutability check? > >As I said, put it in the hash function of those types >where it applies. The generic code should simply call >the hash function, or if there is no hash function, >raise an exception. So the tuple hash call will effectively check the immutable bit recursively as it gets the hash value for each item it contains. That will work out great. I finally really understand what you are talking about.