bloke at ii.net
Wed Aug 28 05:32:28 CEST 2002
One thing I like about Python is its flexibility. But flexibility comes at
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.
I can think of a number of uses, in particular taking a short-cut in coding.
But it could easily become unreadable. My first thought was to avoid it
like the plague.
Then I thought there may be a legit reason for doing so, and couldn't think
"Gonçalo Rodrigues" <op73418 at mail.telepac.pt> wrote in message
news:9e9nmuc6ev4a4aar1sqbarvdqmdr3mj30s at 4ax.com...
> On Tue, 27 Aug 2002 09:43:24 +0800, "Rob Hall" <bloke at ii.net> wrote:
> >I was just reading through the Python Tutorial. In section 9.2 (python
> >Scopes and Name Spaces) it says you can delete attributes (eg del
> >This seems dangerous to me. Can anyone give me a legitimate reason or eg
> >for why you would want to do this?
> I also get nervous when deleting attributes from instances, but remember
> that Python is a very dynamic language allowing you *to add* attributes
> to instances at anytime whatsoever. Deleting attributes is just the
> other side of the coin.
> Best regards,
> Gonçalo Rodrigues
More information about the Python-list