John Salerno a écrit :
> Paul Rubin wrote:
> 
>> John Salerno <[EMAIL PROTECTED]> writes:
>>
>>> I just need some advice for how to structure
>>> the check of the empty string.
>>
>>
>> How about
>>
>>     return db_name or None
>>
>> since the empty string taken as a boolean is False.
> 
> 
> But if the user doesn't enter any text, I don't want the method to 
> return at all (even None). 

John, please re-read the FineManual(tm). None is the default return 
value of a function - even if there's no return statement.

 >>> def noop():
...     pass
...
 >>> assert noop() is None
 >>>

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

Reply via email to