Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55746
| Path | csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.swapon.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail |
|---|---|
| From | Frank Dierkes <Frank.Dierkes@googlemail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: multiple values for keyword argument |
| Date | 29 Jan 2011 13:43:44 GMT |
| Lines | 25 |
| Message-ID | <8qijsgFgu1U1@mid.dfncis.de> (permalink) |
| References | <alpine.LSU.2.00.1101291200340.7991@Tux.site> <9f669337-6116-4442-9c7e-54b0051e33a2@8g2000prb.googlegroups.com> <alpine.LSU.2.00.1101291417350.7717@Tux.site> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.dfncis.de 49sucS8/IbE6HpiDnrirNAnLJTiTqWMncC95AnlXRfmBvXpMzRtU25S30I |
| Cancel-Lock | sha1:M2T9MK8IxT7iH07CZ6V/ox2zk3g= |
| User-Agent | Pan/0.133 (House of Butterflies) |
| Xref | csiph.com comp.lang.python:55746 |
Show key headers only | View raw
On Sat, 29 Jan 2011 14:18:30 +0100, Tobias Blass wrote: > On Sat, 29 Jan 2011, Francesco Bochicchio wrote: > >>> class MainWin(Frame): >>> def create_edit(row,self): >>> def create_edit(self, row): >> >> >> > Ok it works now. So the problem was that python requires 'self' to be > the first parameter? If you define an instance method, the first parameter is always the instance passed to the method - regardless of the parameters name. In your case the instance was passed to the row parameter. Then again you wanted to pass i to it. That's why the exception was raised. If you just had typed self.create_edit(i), then row would have been the instance (*self*.create_edit(...)) and self would have been i. Naming the first parameter self is only a convention. It could be any other name, too.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: multiple values for keyword argument Frank Dierkes <Frank.Dierkes@googlemail.com> - 2011-01-29 13:43 +0000
csiph-web