A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-October/049657.html below:

[Python-Dev] adding Py{String|Unicode}_{Lower|Upper} and fixing CreateProcess in _subprocess.pyd and PyWin32

[Python-Dev] adding Py{String|Unicode}_{Lower|Upper} and fixing CreateProcess in _subprocess.pyd and PyWin32 [Python-Dev] adding Py{String|Unicode}_{Lower|Upper} and fixing CreateProcess in _subprocess.pyd and PyWin32Raymond Hettinger python at rcn.com
Wed Oct 27 10:47:36 CEST 2004
> However, I'd like some guidance on the best way to case-insensitively
> sort a Python list in C code to fix (B). The best thing I see would be
> to expose PyString_Lower/PyUnicode_Lower and/or
> PyString_Upper/PyUnicode_Upper so they can be used to
.lower()/.upper()
> the given environment mapping keys for sorting.

Why not mimic the pure python approach?

lowerfunc = PyObject_GetAttrString(&PyUnicode_Type, "lower");
PyObject_CallMethod(mylist, "sort", "OO", Py_None, lowerfunc);



Raymond

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4