The result below for x.split() is what I want because there is no unicode in the result.
server:~ brian$ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 'M Y'
>>> x.split()
['M', 'Y']
But in my application using db.get
as below, the result for choices
is [u'M', u'Y']
instead, when 'choices'
= 'M Y'
.
def post(self, blog_id):
blog = db.get(db.Key.from_path('Blogs', blog_id))
n = Reminders(parent=blog, purpose=self.request.get('purpose'),
choices=self.request.get('choices').split())
n.put()
How can I get my desired result?
This question is different from the other one because it seems as if google-app-engine or python2.7 forces the u'' around each element of the sequence that is split. I have tried using .encode('ascii','ignore')
also, but to no avail.