[Ironpython-users] IronPython, Daily Digest 6/21/2013

CodePlex no_reply at codeplex.com
Sat Jun 22 09:18:06 CEST 2013

Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] locale.strxfrm doesn't work



1. [New issue] locale.strxfrm doesn't work
User paweljasinski has proposed the issue:

"locale.strxfrm for locale other than ascii doesn't work
In the following example, sorted should return the same results
IronPython 2.7.4a1 ( on .NET 4.0.30319.296 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_COLLATE,"de_CH")
>>> print sorted([u'a', u'z', u'ä'], cmp=locale.strcoll)
['a', u'\xe4', 'z']
>>> print sorted([u'a', u'z', u'ä'], key=locale.strxfrm)
['a', 'z', u'\xe4']

For now the workaround is to use cmp instead. However cmp is gone in 3.x. In this case the following can be used as quick workaround:
>>> import functools
>>> print sorted([u'a', u'z', u'ä'], key=functools.cmp_to_key(locale.strcoll))
['a', u'\xe4', 'z']

code inspection reveals: 
[Documentation(@"returns a transformed string that can be compared using the built-in cmp. 
Currently returns the string unmodified")]
public static object strxfrm(string @string) {
    return @string;

You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130622/372f8b14/attachment.html>

More information about the Ironpython-users mailing list