[Patches] [ python-Patches-636005 ] Filter unicode into unicode

SourceForge.net noreply@sourceforge.net
Sat, 25 Jan 2003 14:50:47 -0800


Patches item #636005, was opened at 2002-11-09 21:15
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=636005&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Martin v. Löwis (loewis)
Summary: Filter unicode into unicode

Initial Comment:
Currently, filter(None, "abc") gives "abc", but
filter(None, u"abc") gives [u'a', u'b', u'c']. This
patches corrects this, adding a Unicode specical case
for filter.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2003-01-25 23:50

Message:
Logged In: YES 
user_id=21627

Committed as

test_builtin.py 1.4
NEWS 1.625
bltinmodule.c 2.271


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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-01-23 23:49

Message:
Logged In: YES 
user_id=80475

Looks good, compiles fine, passes regrtests, doesn't 
appear to have any leaks, and looks like a faithful 
interpretation of filterstring() just above it.

Consider expanding the tests to verify the
return type.  Since 'abc' == u'abc', the
current tests would pass even if the return
type were a non-unicode string.

Please apply.

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-01-21 22:38

Message:
Logged In: YES 
user_id=21627

Argh! I lost it, so I had to recreate. It is attached now.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-01-19 04:04

Message:
Logged In: YES 
user_id=80475

Do you still have this patch available?

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

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-11-11 10:11

Message:
Logged In: YES 
user_id=38388

There's no patch attached to this SF item, but
you're right, filter() should behave in the same
way for 8-bit strings as for Unicode.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=636005&group_id=5470