On Sun, Apr 15, 2012 at 8:41 AM, Mahmoud Abdel-Fattah
<accou...@abdel-fattah.net> wrote:
> item['author_brand'] = author_brand.group(2) if type(author_brand) != None
> else ''

Almost there! :)

None is a singleton, not a type; you don't need to check
type(author_brand) but rather its identity. Use "author_brand is not
None" for your condition and it should work like you're expecting. In
this case, you can actually just use "author_brand" as your condition
(no quotes, of course), as None evaluates as false.

Chris Angelico
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to