[Zope-dev] Re[2]: differences in PropertyManager._setPropValue
Victor Safronovich
vsafronovich at naumen.ru
Tue Nov 1 08:00:40 EST 2005
Hello Florent Guillaume,
Monday, October 31, 2005, 6:25:20 PM, you wrote:
FG> This was changed because have mutable objects stored as properties can lead
FG> to unexpected behavior. Do you mean you have a custom proprty type called
FG> "list"?
yes, my own property of type 'list'. I don`t find any restriction on type of
the property, only in comment of the PropertyManager class:
The 'type' string must be one of the values: 'float', 'int', 'long',
'string', 'lines', 'text', 'date', 'tokens', 'selection', or
'multiple section'.
But PropertyManager support any custom types not only types descriped above.
For example Publisher supports ':list' and ':tuple' converters (but only in
HTTPRequest.processInputs method, it is impossible to manage 'list',
'tuple', 'records' types through converters.py module, pitifully )
FG> What's your use case for it, and why can't tuple fit the bill ?
My code use the 'sort' method of the python list type. Of course this is
ugly to trust the getProperty result, and my code should be manually convert
the getProperty result to list.
of course i repaire my code, but how chould i escape from incompatible behavior
of the zope versions in future? may be write more tests to PropertyManager class? or
how?
--
Best regards,
Victor Safronovich
NauMen.NauDoc.SoftwareDeveloper http://www.naumen.ru
More information about the Zope-Dev
mailing list