On May 4, 5:46 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> Mike wrote:
> > I just realized in working with this more that the issues I was having
> > with instancemethod and other things seems to be tied solely to
>
> What you describe below is a function that happens to be an attribute of an
> in
Mike wrote:
> I just realized in working with this more that the issues I was having
> with instancemethod and other things seems to be tied solely to
What you describe below is a function that happens to be an attribute of an
instance. There are also "real" instance methods that know about "thei
On May 4, 2:05 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> Mike wrote:
> > staticmethod makes the function available to the whole class according
> > to the docs. What if I only want it to be available on a particular
> > instance? Say I'm adding abilities to a character in a game and I want
> > t
Mike wrote:
> staticmethod makes the function available to the whole class according
> to the docs. What if I only want it to be available on a particular
> instance? Say I'm adding abilities to a character in a game and I want
> to give a particular character the ability to 'NukeEverybody'. I don
On May 3, 11:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Thu, 03 May 2007 16:52:55 -0300, Mike <[EMAIL PROTECTED]> escribió:
>
> > I was messing around with adding methods to a class instance at
> > runtime and saw the usual code one finds online for this. All the
> > examples I saw
En Thu, 03 May 2007 16:52:55 -0300, Mike <[EMAIL PROTECTED]> escribió:
> I was messing around with adding methods to a class instance at
> runtime and saw the usual code one finds online for this. All the
> examples I saw say, of course, to make sure that for your method that
> you have 'self' as
On May 3, 10:52 pm, Mike <[EMAIL PROTECTED]> wrote:
> I was messing around with adding methods to a class instance at
> runtime and saw the usual code one finds online for this. All the
> examples I saw say, of course, to make sure that for your method that
> you have 'self' as the first parameter.
Mike wrote:
> I was messing around with adding methods to a class instance at
> runtime and saw the usual code one finds online for this. All the
> examples I saw say, of course, to make sure that for your method that
> you have 'self' as the first parameter. I got to thinking and thought
> "I have
In the above example 'addm' should be 'AddMethod'
superdict = AddMethod(dict(), lambda self, d:
myUtils.HasDrive(d),"hasdrive")
--
http://mail.python.org/mailman/listinfo/python-list
I was messing around with adding methods to a class instance at
runtime and saw the usual code one finds online for this. All the
examples I saw say, of course, to make sure that for your method that
you have 'self' as the first parameter. I got to thinking and thought
"I have a lot of arbitrary me
10 matches
Mail list logo