Path: csiph.com!au2pb.net!feeder.erje.net!2.eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Question about code writing '% i, callback' Date: Mon, 30 Nov 2015 20:44:09 -0500 Organization: IISS Elusive Unicorn Lines: 25 Message-ID: References: <25af8ac3-5fc7-44bd-a73f-7a870b69515a@googlegroups.com> <53ef7ef4-cfec-4c91-a45c-5b847dde8fad@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de ldpzjz+pqeCYhPPWpSNB7wYFFndlidrc2MBS1Kp1wOTg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Question': 0.05; 'subject:code': 0.07; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'callback)': 0.16; 'ian.': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:writing': 0.16; 'url:home': 0.18; '2015': 0.20; '%s"': 0.22; 'fit': 0.23; 'mon,': 0.24; 'example': 0.26; 'header:X -Complaints-To:1': 0.26; 'class.': 0.30; 'another': 0.32; 'class': 0.33; 'case,': 0.34; 'instance': 0.35; 'nov': 0.35; 'item': 0.35; 'there': 0.36; 'created': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:org': 0.37; 'charset :us-ascii': 0.37; 'whatever': 0.39; 'does': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-79-219-161.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99763 On Mon, 30 Nov 2015 10:55:23 -0800 (PST), fl declaimed the following: >Thanks Ian. I created the class because I want to use the original example >line > > UI.Button("button %s" % i, callback) > >Is there another way to use the above line without my class definition? >I do feel that my created class does not match well with the above line >because the first item "button %s" does not fit __self__ in the class. The first item passed to a method call is the instance object... In this case, whatever "UI" is bound to. If it helps, think of UI.Button("string", callback) as Button(UI, "string", callback) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/