[Python-3000] Thoughts on dictionary views
Delaney, Timothy (Tim)
tdelaney at avaya.com
Wed Feb 21 02:03:28 CET 2007
Larry Hastings wrote:
> Delaney, Timothy (Tim) wrote:
>> A view is a lightweight object that implements an interface by
>> delegating to an underlying object. The underlying object cannot be
>> changed through the view, but could be changed directly, in which
>> case the view will reflect the new contents of the object.
> It certainly makes sense that views would *usually* be read-only, but
> is that really a *requirement*?
No, but I think it would be worthwhile (and definitely simplest) if the
standard concept of a view in python was read-only.
Then any non-read-only view becomes the exception, and needs to be
flagged as such.
More information about the Python-3000