Why doesn't this work?
>>> class A (unicode):
... def __init__ (self, value):
... super(unicode, self).__init__(str(value).upper())
...
>>> assert A('hello') == u'HELLO'
Traceback (most recent call last):
File "<pyshell#39>", line 1, in <module>
assert A('hello') == u'HELLO'
AssertionError
>>>
I know that without the init method initializing the object would default to the unicode classes init method (thank you MRO) and I know that my init method is the one being called, however it doesn't seem to want to work. Even when I add an extra line and explicitly set the value of the value parameter to upper it still doesn't want to work.
Although I can (and probably will have to) define the repr and str special classes in order to get the desired effect, I'm a little curious as to why this doesn't work.
Thanks in advance.