[Tutor] problem when subclassing tuple

Gregor Lingl glingl at aon.at
Sun Jan 25 06:28:59 EST 2004

Thanks, Karl, for this idea ...

>Maybe I don't understand what you want to achieve exactly but what about
>overriding __new__ instead of __init__? (I had the idea when I read
>class vec(tuple):
>    def __new__(cls, x,y,z):
>        return tuple.__new__(cls, [x,y,z])
It works well. And also for your hint to 
which contains all the information I need.


More information about the Tutor mailing list