David Pratt wrote:
...
import new

class FirstBase(object):
    foo = 'bar'
    biz = 'baz'

class SecondBase(object):
    bla = 'blu'
    buz = 'brr'

attr = {
    'fiz': 'An attribute', 'fuz': 'Another one'}

Test = new.classobj(
^^^ replace with:
  Test = type(
    'Test', (FirstBase, SecondBase), attr)

class MyNewClass(Test):
    pass

a = MyNewClass()

print a.foo, a.buz, a.fiz, type(a)
> ...

It's really that simple.

--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to