[Ironpython-users] type for unicode and str

Jeff Hardy jdhardy at gmail.com
Wed Feb 1 15:55:25 CET 2012


In IronPython str and unicode are the same type, which is .NET's
System.String. It's easily the biggest difference between CPython 2
and IronPython. The distinction goes away for Python 3, where strings
are always Unicode.

- Jeff

On Tue, Jan 31, 2012 at 8:54 PM, Daniel Fernandez
<fernandez_dan2 at hotmail.com> wrote:
> Hi All,
>
> I was just playing with unicode strings and I notice a difference with
> CPython and IronPython. On CPython 2.7.2 I get the following
>
>>>> type(u"A")
> <type 'unicode'>
>>>> type("A")
> <type 'str'>
>
> On Ironpython the latest 2.7.2 Alpha 1 I get the following
>
>>>> type(u"A")
> <type 'str'>
>>>> type("A")
> <type 'str'>
>
>
> I decided to crack open the source and see where this type function is
> defined. I followed to the builtin.cs with the PythonModule but I got kind
> lost there. If anyone can provide some helpful hints that would be great.
>
> Thanks
>
> Danny
>
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users
>


More information about the Ironpython-users mailing list