Re: [Tutor] Dynamic Method Creation

2008-07-11 Thread Kent Johnson
On Thu, Jul 10, 2008 at 1:38 PM, Chris Fuller <[EMAIL PROTECTED]> wrote: > You can also use new.classobj() to create arbitrary classes on-the-fly. See > the documentation for the new module, and google "python metaclasses" FWIW new.classobj() will create an old-style class. You can create a new

Re: [Tutor] Dynamic Method Creation

2008-07-10 Thread Chris Fuller
On Thursday 10 July 2008 09:09, George Flaherty wrote: > Hello, > > I am trying to port over some old code from Ruby into Python. In my old > ruby code I had a UnitTest class that created a bunch of test methods (i.e. > def test_MyTestFunction) dynamically through the ruby method > define_method(h

Re: [Tutor] Dynamic Method Creation

2008-07-10 Thread Alan Gauld
"George Flaherty" <[EMAIL PROTECTED]> wrote ) dynamically through the ruby method define_method(http://www.ruby- doc.org/core/classes/Module.html#M000396). > This functionally allowed me to create any number of methods dynamically within a particular class. I am pretty sure python can handl

Re: [Tutor] Dynamic Method Creation

2008-07-10 Thread bob gailer
George Flaherty wrote: Hello, I am trying to port over some old code from Ruby into Python. In my old ruby code I had a UnitTest class that created a bunch of test methods (i.e. def test_MyTestFunction) dynamically through the ruby method define_method(http://www.ruby-doc.org/core/classes/Mo

[Tutor] Dynamic Method Creation

2008-07-10 Thread George Flaherty
Hello, I am trying to port over some old code from Ruby into Python. In my old ruby code I had a UnitTest class that created a bunch of test methods (i.e. def test_MyTestFunction) dynamically through the ruby method define_method(http://www.ruby-doc.org/core/classes/Module.html#M000396). This