python class question

Chris Liechti cliechti at gmx.net
Fri Jul 26 06:13:01 EDT 2002


Jonathan Hogg <jonathan at onegoodidea.com> wrote in
news:B966BE75.E94D%jonathan at onegoodidea.com: 

> On 25/7/2002 19:38, in article
> Xns9256D2197BD87cliechtigmxnet at 62.2.16.82, "Chris Liechti"
> <cliechti at gmx.net> wrote: 
> 
>>> class xrml(SimpleItem.SimpleItem):
>>>      def init_db(self):
>>>           try:
>>>                dbc = getattr(self, connection)
>> 
>> why not:
>> dbc = self.connection
> 
> Because that won't work. Look again at the code above. It gets an
> attribute of self with the *name* stored in 'connection'.

oh, you're right. sorry to the OP.
and it wasn't that late when i wrote that... <wink>

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list