"BJörn Lindqvist" <[EMAIL PROTECTED]> writes: > On 1/16/07, Ben Finney <[EMAIL PROTECTED]> wrote: > > Use the supplied value as you expect to be able to use it, and > > catch the exception (somewhere) if it doesn't work. That will > > allow *any* type that exhibits the correct behaviour, without > > needlessly restricting it to a particular inheritance. > > Can you show an example of that? It seems like that approach would > lead to some very convoluted code.
Perhaps so. I don't recommend either of those approaches; I recommend, instead, separate factory functions for separate input types. -- \ "When I was crossing the border into Canada, they asked if I | `\ had any firearms with me. I said, 'Well, what do you need?'" | _o__) -- Steven Wright | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list