Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'class,': 0.07; 'suppose': 0.07; '8bit%:30': 0.09; 'arguments': 0.09; 'caller': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '*function*': 0.16; 'arg2,': 0.16; 'attribute,': 0.16; 'finney': 0.16; 'function;': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:usage': 0.16; ':-)': 0.16; 'example': 0.22; 'header:User-Agent:1': 0.23; 'now?': 0.24; 'question': 0.24; 'shown': 0.26; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; "i'm": 0.30; 'writes:': 0.31; 'url:python': 0.33; 'sense': 0.34; 'skip:s 30': 0.35; 'but': 0.35; 'object,': 0.36; 'possible': 0.36; 'url:org': 0.36; 'so,': 0.37; 'ben': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'is.': 0.60; 'free': 0.61; 'such': 0.63; 'choose': 0.64; '8bit%:24': 0.84; 'brain,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: functools and objective usage Date: Wed, 23 Oct 2013 09:13:33 +1100 References: <1382478989.4873.6.camel@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:C+5b+xX60cRK7DA3gBbQ8S5Hnp0= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382480027 news.xs4all.nl 15864 [2001:888:2000:d::a6]:59806 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57323 Mohsen Pahlevanzadeh writes: > Suppose i have function name, 3 arguments for it, and object of its > caller such as self.blahbalah This doesn't make much sense to me. I think you mean: You have an object, ‘self.blahblah’, which has a function attribute, ‘name’. (Aside: Please choose better example names, these make it rather difficult to talk about.) > So: > my function is: > self.blahblah.name(arg1,arg2,arg3) Your *function* is ‘self.blahblah.name’. One possible way to express a *call* that function is ‘self.blahblah.name(arg1, arg2, arg3)’. > I read functools documentations, may be objictive usage and > functionality differ, Do you have experience with objective usage ? > http://docs.python.org/2/library/functools.html#partial-objects I don't understand what the question is. You have shown a way to call your function; what do you want to do now? > I need to use it in my class, Feel free :-) -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\ Brain, but I find scratching just makes it worse.” —_Pinky and | _o__) The Brain_ | Ben Finney