deleting attributes

Greg Ewing see_reply_address at something.invalid
Tue Aug 27 23:55:10 EDT 2002


Rob Hall wrote:

> My question (though worded badly) was not so much about the security
> implications, but whether there are any legitimate reasons for deleting an
> attribute that falls within the Python idiom.


Before the "as" clause was added to the import
statement, there used to be an idiom used for
doing the equivalent:

import name1
name2 = name1
del name1

So it's rare, but occasionally legitimate uses are
found for it.

Also, as was pointed out, the ability to add attributes
implies that, for completeness, there ought to be a
way of deleting them too.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list