[EMAIL PROTECTED] wrote:
Robert,

Appreciate your response.

However Guido says here that types was never intended to be used like
that:

http://bugs.python.org/msg58023

quote: "The types module was only ever intended for type
checking, not for creating new instances.

The correct solution will be to use whatever we end up deciding about
pyvm. Certainly the types module will go."

So that does not seem like a very long term solution to me?

Hmm. Interesting. Anyways, if adding a method to a class is the only use case you care about, you can just add the function itself. You don't have to make a method object from it.

In [14]: A.foo = foo

In [16]: a = A()

In [17]: a.foo('See?')
See?

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to