Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: confused about the different built-in functions in Python Date: Tue, 27 May 2014 11:14:38 +1200 Lines: 16 Message-ID: References: <648e6136a80.00000651codemonkey@inbox.com> <6C977160E42.0000036Ccodemonkey@inbox.com> <87r43gfjqy.fsf@elektro.pacujo.net> <87ioosffh3.fsf@elektro.pacujo.net> <87egzgfe9u.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net TaZMkcX+GwoaShUJaxUQFQO51oqAUNFjWZCMbNirP8L23EoFTy Cancel-Lock: sha1:e/lLNctTuONmfbxl7KG3k2cY/JQ= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <87egzgfe9u.fsf@elektro.pacujo.net> Xref: csiph.com comp.lang.python:72091 Marko Rauhamaa wrote: > IOW, you can override a method with setattr() but you cannot delete a > method with delattr(). Actually, you can -- but you need to delete it from the class, not the instance: >>> delattr(X, 'f') >>> x.f() Traceback (most recent call last): File "", line 1, in AttributeError: 'X' object has no attribute 'f' -- Greg