How to check if a string is empty in python?

Steven D'Aprano steve at REMOVEME.cybersource.com.au
Thu May 3 02:02:44 EDT 2007


On Wed, 02 May 2007 21:59:56 -0700, Alex Martelli wrote:

> Steven D'Aprano <steve at REMOVEME.cybersource.com.au> wrote:
> 
>> On Wed, 02 May 2007 21:19:54 -0400, Roy Smith wrote:
>> 
>> > for c in s:
>> >    raise "it's not empty"
>> 
>> String exceptions are depreciated and shouldn't be used.
>> 
>> http://docs.python.org/api/node16.html
> 
> They're actually deprecated, not depreciated.

Er, um... oh yeah... I knew that... 

I mean... yes, that was deliberate, to see who was paying attention. Well
done Alex!



-- 
Steven D'Aprano 




More information about the Python-list mailing list