Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57323 > unrolled thread

Re: functools and objective usage

Started byBen Finney <ben+python@benfinney.id.au>
First post2013-10-23 09:13 +1100
Last post2013-10-23 09:13 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: functools and objective usage Ben Finney <ben+python@benfinney.id.au> - 2013-10-23 09:13 +1100

#57323 — Re: functools and objective usage

FromBen Finney <ben+python@benfinney.id.au>
Date2013-10-23 09:13 +1100
SubjectRe: functools and objective usage
Message-ID<mailman.1387.1382480027.18130.python-list@python.org>
Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> 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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web