In article <mailman.2090.1261159213.2873.python-l...@python.org>,
Steve Holden  <st...@holdenweb.com> wrote:
>Julian wrote:
>> 
>> But:
>> 
>> - none classification: return an exception or None? I think None is
>> better, hence its not an exception that there is no classification but
>> a defined state. What do you think?
>> - many classifications: what to do? retun a sequence of strings? raise
>> an exception and implement another method wich returns than the
>> classifications? what should I do here?
>
>Always return a list or tuple. For no classifications it should be
>empty, for one classification it should have one element, ... , for N
>classifications it should have N elements.

Why not a set?  If you're only going list classifications, a tuple or
list would be fine, but if you're going to probe classifications, you
should use something that isn't O(N).
-- 
Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to