[IronPython] repr() results with uint, etc.

Dino Viehland dinov at microsoft.com
Sat Feb 7 06:05:27 CET 2009


There's no existing functionality to do this but we could add __repr__ overloads onto the built-in types.  They would presumably return something like:

System.UInt32(1)

or:

UInt32(1)

Could you open a bug?

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Slutter
Sent: Friday, February 06, 2009 8:48 PM
To: Discussion of IronPython
Subject: [IronPython] repr() results with uint, etc.

I have functions (in C#) that return results as everything from byte,
sbyte, System.UInt16, int, uint, float, etc.

If I use repr() on the returned value within IP2.0 only bool, int,
int64, float, double and string types print out a nice value using repr.

The other types (byte, char, sbyte, uint16, int16, uint, uint64) all
print out like:
<System.UInt32 object at 0x000000000000002B [5]>


Is there a way to get repr to print out a nice result like int types?
(some way from inside IronPython, a different version of repr?)

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