[Python-Dev] Re: Proposal for a modified import mechanism. (original) (raw)

Michael McLay mclay@erols.com
Sun, 11 Nov 2001 10:45:35 -0500


mal> will have to be a read-only type (e.g. a read-only mal> dictionary). SM>There was discussion once upon a time about adding a read-write flag to SM>dictionaries to prevent modification during sensitive times. I gather SM> lists already have such a flag to allow in-place sorting to work.

The member description returned by addmembers() allows types to be specified for an attribute. It would be trivial to add another flag to mark the member as read only. You could also add methods to the PyExtendedMemberDescrObject to allow the state to be turned on at the begining of the switch and off at the end of the switch.