Actually, scrape what I said.<br><br>I think you need to have <span style="font-family: courier new,monospace;">metaclass </span>in the class statement, not just <span style="font-family: courier new,monospace;">meta</span>.<br>

<br>-Xav<br><br><div class="gmail_quote">On 31 August 2010 00:16, Xavier Ho <span dir="ltr"><<a href="mailto:contact@xavierho.com">contact@xavierho.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Ethan, are you trying to write the constructor in the class statement?<br>
<br>Cheers,<br>Xav<div><div></div><div class="h5"><br><br><div class="gmail_quote">On 31 August 2010 00:10, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank">ethan@stoneleaf.us</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Good Day!<br>
<br>
I am stuck... hopefully a few fresh pairs of eyes will spot what I am missing.<br>
<br>
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:<br>
<br>
C:\Python31\Lib\site-packages\traits\tests>\python31\python tests.py<br>
Traceback (most recent call last):<br>
  File "tests.py", line 4, in <module><br>
    class TraitConflict(meta=Traits, traits=(BoxPrint, BigBoxPrint)):<br>
TypeError: type() takes 1 or 3 arguments<br>
<br>
<br>
Working code from test_traits.py:<br>
class DerivedClass(metaclass=Traits, traits=(TBundle1, TBundle2)):<br>
    def repeat(yo, text, count):<br>
        print('whatever...')<br>
    def whatsit(yo, arg1):<br>
        print("calling baseclass's whatsit...")<br>
        print(super().whatsit(arg1))<br>
<br>
Failing code from tests.py:<br>
class TraitConflict(meta=Traits, traits=(BoxPrint, BigBoxPrint)):<br>
    def useless(yo):<br>
        print("this class won't compile")<br>
<br>
<br>
Any clues or pointers *greatly* appreciated!<br>
<br>
~Ethan~<br>
--<br>
Traits is homegrown, the idea based on Michele Simionato's Simple Traits experiment.  It was intrigueing, and I wanted to see if I could implement something similar in Python 3.  Any ideas now on what to do with it will also be greatly appreciated!  :)<br>


<font color="#888888">
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>