Closed mauritsvanrees closed 5 years ago
Some of the methods of the RedirectionStorage can be easily registered under an extra name to allow for more Pythonic use:
RedirectionStorage
add
__setitem__
storage['x'] = 'y'
remove
__delitem__
del storage['x']
has_path
__contains__
'x' in storage
get
__getitem__
storage['x']
__len__
len(storage)
We should of course keep the old name for backwards compatibility.
We could immediately replace our own usage (and usage in CMFPlone) to use the new style, but that has no hurry.
I have this almost ready.
This was fixed 20 days ago. Closing.
Some of the methods of the
RedirectionStorage
can be easily registered under an extra name to allow for more Pythonic use:add
->__setitem__
, allows usingstorage['x'] = 'y'
remove
->__delitem__
, allows usingdel storage['x']
has_path
->__contains__
, allows using'x' in storage
get
->__getitem__
(with some minor edits), allows usingstorage['x']
__len__
, allows usinglen(storage)
We should of course keep the old name for backwards compatibility.
We could immediately replace our own usage (and usage in CMFPlone) to use the new style, but that has no hurry.
I have this almost ready.