Generic constructors and duplication of internal Python logic
John J. Lee
jjl at pobox.com
Mon Apr 19 17:53:55 EDT 2004
michele.simionato at poste.it (Michele Simionato) writes:
> jjl at pobox.com (John J. Lee) wrote in message news:<87ekqq41ya.fsf at pobox.com>...
> > I have to check things like:
> >
> > -are there too many positional arguments?
> > -any unexpected keyword arguments?
> > -multiple keyword arguments?
> > -any duplication between positional and keyword arguments?
> >
> > etc.
> >
> > Surely there's some easy way of making use of Python's internal logic
> > here? For some reason, I can't see how. Can anybody see a way?
> >
> >
> > John
>
> Have you thought of performing the checks in the __call__ method
> of a custom metaclass?
No. How would that help?
John
More information about the Python-list
mailing list