what should we use instead of the 'new' module?
robert.kern at gmail.com
Thu Nov 13 05:13:54 CET 2008
flrump at gmail.com wrote:
> Appreciate your response.
> However Guido says here that types was never intended to be used like
> 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 : A.foo = foo
In : a = A()
In : a.foo('See?')
"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
More information about the Python-list