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

----------------------------------------------

ISSUES

1. [New issue] locale.strxfrm doesn't work
http://ironpython.codeplex.com/workitem/34188
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 (2.7.0.40) 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")
'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.
_______________________________________________
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to