Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'initialize': 0.05; 'class,': 0.07; 'received:192.168.178': 0.07; 'advice.': 0.09; 'specifying': 0.09; 'worked.': 0.09; 'def': 0.10; 'notations': 0.16; 'type:': 0.16; 'module': 0.19; 'statement': 0.23; 'downloaded': 0.24; 'tried': 0.25; 'header:User-Agent:1': 0.26; 'charset:iso-8859-15': 0.26; 'integrate': 0.27; 'things,': 0.29; 'definition': 0.29; 'class': 0.29; 'code': 0.31; 'to:addr:python- list': 0.33; 'hi,': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'offered': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'message-id:@gmail.com': 0.36; 'method': 0.36; 'received:209': 0.37; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'build': 0.39; 'received:192.168': 0.40; 'header:Reply-To:1': 0.68; 'reply- to:no real name:2**0': 0.72; 'reply-to:addr:gmail.com': 0.79; 'bob': 0.91; 'net.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:reply-to:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=Bmqk575B6T3oBpkuYmN9RLCKE/XmZDo49emSkiRfm5o=; b=L5wGORO575Y0zqgwrZYbF/1vVw68i4PDkiPvQic789igMs5n6ULnlveyBHyQJH1jG4 c8rjqomaoYGIlQl0Wei3334UlW6oNN8f8HmG48Uq4Wi+dmZEG3XR9PiX4NIv/QFB0UsC 8QIKO6DMWyK1bGT90Qj74/gO7dKIzQjY0i7jFOLfpbZxKiprv/PZa32tWfb1d3gA8BXT Ivo5fh1+8VNq/3jK4HXUEffkhBIrW17nZmFtnuWuD+OoB2qSOKLL7Bz2ezWSLNA34XCH D9dixEUb3WM8D9xV9N/qH3AKhAyNZhKfgMOYJHTPn95t4p2CQQjf5fLkUcwrZgdBa6n6 xsdQ== X-Received: by 10.14.182.137 with SMTP id o9mr10240223eem.13.1360947568677; Fri, 15 Feb 2013 08:59:28 -0800 (PST) Date: Fri, 15 Feb 2013 17:59:29 +0100 From: Bob Brusa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: inheritance and how to use it Content-Type: text/html; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: bob.brusa@gmail.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360947575 news.xs4all.nl 6985 [2001:888:2000:d::a6]:55379 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38929 Hi,
I use a module downloaded from the net. Now I want to build my own class, based on the class SerialInstrument offered in this module - and in my class I would like to initialize a few things, using e. g. the method clear() offered by SerialInstrument. Hence I type:

class myClass(SerialInstrument)
    self.clear(self)
    def f1(self, str1, str2)
        ...do something etc.

I then get the message "self not know" from the statement self.clear(self). I have tried many other notations - none worked. What works is however the following code - specifying myClass without the self.clear(self) in it:

x = myClass("argument")
x.clear()

How can I integrate this call into the definition of myClass? Thanks for advice.
Bob