Python returns string is both str and unicode type
<p>We have a .NET app that can be customized by IronPython (version 2.7.5)</p>

<p>Here is the script code:</p>

<pre><code>stringToPlay = # get it from our .NET app interface toward python here. The method returns .NET string

Log.Write("isinstance(stringToPlay, unicode): ", str(isinstance(stringToPlay, unicode)))

Log.Write("isinstance(stringToPlay, str): ", str(isinstance(stringToPlay, str)))
</code></pre>

<p>Both log lines will return True ??</p>

<p>stringToPlay value is "ÐÐ¸ÑÐ¸Ð»Ð¸ÑÐ°" .</p>

<p>How is this possible when str and unicode should be two separate classes both inheriting from basestring?</p>

<p>Thank you</p>

<p>In IronPython, the <code>str</code> type and the <code>unicode</code> type are the same object. The .NET string type is unicode.</p>

python .net unicode ironpython