meta-class troubles

E

Ethan Furman

Good Day!

I am stuck... hopefully a few fresh pairs of eyes will spot what I am
missing.

I have a metaclass, Traits, and two different testing files,
test_traits.py and tests.py. test_traits works fine, tests generates
the following error:

C:\Python31\Lib\site-packages\traits\tests>\python31\python tests.py
Traceback (most recent call last):
File "tests.py", line 4, in <module>
class TraitConflict(meta=Traits, traits=(BoxPrint, BigBoxPrint)):
TypeError: type() takes 1 or 3 arguments


Working code from test_traits.py:
class DerivedClass(metaclass=Traits, traits=(TBundle1, TBundle2)):
def repeat(yo, text, count):
print('whatever...')
def whatsit(yo, arg1):
print("calling baseclass's whatsit...")
print(super().whatsit(arg1))

Failing code from tests.py:
class TraitConflict(meta=Traits, traits=(BoxPrint, BigBoxPrint)):
def useless(yo):
print("this class won't compile")


Any clues or pointers *greatly* appreciated!

~Ethan~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top