I've updated the property system, so that in-place modifications work. This means that all the usual ways of updating a list or dict should work correctly.
But there are a couple of corner cases:
- A world property (one defined by the creator) is immutable. If you define a value array in the build interface, and try to modify it in code, the changes won't stick.
- (However, if you assign a new array value in code, that becomes an instance property, which can be modified as expected.)
- If you modify a value so that it's equal to the old value, the change will not stick. For example, if you try this:
- Code: Select all
ls = [0, 1, 2]
ls[1] = 1.0
...the ls property will still be [0, 1, 2] afterwards. This is because the new value is equal to the old value, according to Python's rules: [0, 1, 2] == [0, 1.0, 2]. So the property system doesn't notice a change, so it doesn't write the new value back to the database.
If you notice any property bugs (other than this one :) please report them. This is a deep rewrite of the property-handling code, so it's possible that I screwed something up.