On Fri, Feb 6, 2009 at 9:32 PM, Jeff Slutter <jslut...@reactorzero.com> wrote:
> Ok, looking at the source, I see the issue in:
>
> public static string Repr(CodeContext/*!*/ context, object o)
>
> Is it safe to add these types in to there like:
>            if ((s = o as string) != null) return StringOps.__repr__(s);
>            if (o is int) return Int32Ops.__repr__((int)o);
>            if (o is uint) return ((uint)o).ToString();
>            if (o is long) return ((long)o).ToString() + "L";
>            if (o is ulong) return ((ulong)o).ToString() + "UL";
>            if (o is byte) return ((byte)o).ToString();
>            if (o is sbyte) return ((sbyte)o).ToString();
>            if (o is char) return ((char)o).ToString();
>            if (o is Int16) return ((Int16)o).ToString();
>            if (o is UInt16) return ((UInt16)o).ToString();
> ?

It's traditional (when possible) for repr to return a string
representation of something that can be typed into the interpreter to
get the original object back.  This is what distinguishes it from str.
 That's why Dino suggested the form he did.

--
Curt Hagenlocher
c...@hagenlocher.org
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to