[IronPython] CP Issue #21659: Subclassing unicode
Dino Viehland
dinov at microsoft.com
Tue Mar 17 02:03:26 CET 2009
Does this make it work?
class x(unicode):
def __init__(self, val): pass
def __new__(cls, val):
return unicode.__new__(cls, unicode(val))
x(1)
I've voted for the bug and raised the priority to medium. I've left it proposed until we triage it as a team (we triage bugs every Monday morning so it'll be a week) but I might be able to fix it before then :)
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy
> Sent: Monday, March 16, 2009 5:45 PM
> To: Discussion of IronPython
> Subject: [IronPython] CP Issue #21659: Subclassing unicode
>
> Hi,
> Is there any quick workaround for #21569? It's causing about a third
> of the Genshi errors I'm hitting. Trying to override __init__ in the
> subclass gives the same error.
>
> class Foo(unicode):
> def __init__(self, val):
> pass
>
> f = Foo(1)
>
> Traceback (most recent call last):
> File "foo.py", line 5, in __main__
> TypeError: expected str, got int
>
> Thanks,
> Jeff
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list