deleting attributes
Gonçalo Rodrigues
op73418 at mail.telepac.pt
Tue Aug 27 12:18:37 EDT 2002
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
>modname.the_answer).
>
>This seems dangerous to me. Can anyone give me a legitimate reason or eg
>for why you would want to do this?
>
>Rob
>
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
mailing list