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-boun...@lists.ironpython.com 
[mailto:users-boun...@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@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to