Aahz wrote:
In article <[email protected]>,
Jean-Michel Pichavant  <[email protected]> wrote:
class A:
   def __init__(self, foo = None, bar = None):
       if len(foo) > 5:
                raise ValueError('foo cannot exceed 5 characters')

Bad Idea -- what happens when foo is None?
You're right.
That perfectly illustrates how the simplest solution is the often most valuable one: it is much more easy to find bugs, when there is any.

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

Reply via email to