Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: How to pass class instance to a method? Date: Mon, 26 Nov 2012 11:22:59 +1300 Lines: 17 Message-ID: References: <3193e3dd-0507-4ff7-9026-ee80e5d9c1dd@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net TNIc82fooRNDaWw/GjXOoQcgfJ7BvsWNIHQ1XewPkXwqw1fHo82SvxRaY9qnaT0PQb Cancel-Lock: sha1:+aCHnz4WtpKnRh5Ibz9We79qn7Q= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <3193e3dd-0507-4ff7-9026-ee80e5d9c1dd@googlegroups.com> Xref: csiph.com comp.lang.python:33921 ALeX inSide wrote: > I suppose there shall be some kind of method decorator to treat an argument as an > instance of class? You can do this: xxx = MyClass.some_method and then i = MyClass() xxx(i, foo, bar) Does that help? -- Greg