[Zope3-dev] Re: Make message ids into "rocks"
Dmitry Vasiliev
lists at hlabs.spb.ru
Fri Sep 3 14:35:27 EDT 2004
Jim Fulton wrote:
> Dmitry Vasiliev wrote:
>
>> Jim Fulton wrote:
>
>
> ...
>
>
>>> But that doesn't prevent the mapping from being changed in the
>>> message id. We need to prevent the messaage id's data from being
>>> mutated.
>>
>>
>>
>> I told about following code:
>>
>> mapping = property(lambda self: self.__mapping.copy())
>>
>> So the mapping may be changed only using the % operator, like Philipp
>> suggested.
>
> It many be changed through the _mapping property. Yeah, I know
> that's cheating. ;)
No... It may be changed only through the '_MessageID__mapping' attribute. ;)
>
>>> I suggest we use Python dict proxies, which are proxies
>>> used by new-style classes to prevent modification of their
>>> dictionaries. Unfortunately, creation of these is not
>>> exposed to Python code. Someone will have to whip up a small
>>> C extension to make these creatable from Python. I've proposed
>>> on python-dev to make these creatable from Python, but that wouldn't
>>> happen until Python 2.4 at the soonest.
>>
>>
>>
>> I don't think it's necessary, Philipp already post the pure Python
>> implementation.
>
> That is totally inadequate, as I showed in my reply.
So do you think only a C implementation is acceptable?
--
Dmitry Vasiliev (dima at hlabs.spb.ru)
http://hlabs.spb.ru
More information about the Zope3-dev
mailing list