Package lemon :: Package external :: Package Cheetah :: Package Utils :: Module VerifyType
[show private | hide private]
[frames | no frames]

Module lemon.external.Cheetah.Utils.VerifyType

Functions to verify an argument's type

Meta-Data
================================================================================
Author: Mike Orr <iron@mso.oz.net>
License: This software is released for unlimited distribution under the
         terms of the Python license.
Version: $Revision: 1.1 $
Start Date: 2001/11/07
Last Revision Date: $Date: 2003/08/12 09:17:11 $

Function Summary
  VerifyType(arg, argname, legalTypes, ltd, errmsgExtra)
Verify the type of an argument.
  VerifyTypeClass(arg, argname, legalTypes, ltd, klass, errmsgExtra)
Same, but if it's a class, verify it's a subclass of the right class.

Variable Summary
str __author__ = 'Mike Orr <iron@mso.oz.net>'
str __revision__ = '1.1'

Function Details

VerifyType(arg, argname, legalTypes, ltd, errmsgExtra='')

Verify the type of an argument.

arg, any, the argument.
argname, string, name of the argument.
legalTypes, list of type objects, the allowed types.
ltd, string, description of legal types (for error message).
errmsgExtra, string, text to append to error message.
Returns: None.
Exceptions: TypeError if 'arg' is the wrong type.

VerifyTypeClass(arg, argname, legalTypes, ltd, klass, errmsgExtra='')

Same, but if it's a class, verify it's a subclass of the right class.

arg, any, the argument.
argname, string, name of the argument.
legalTypes, list of type objects, the allowed types.
ltd, string, description of legal types (for error message).
klass, class, the parent class.
errmsgExtra, string, text to append to the error message.
Returns: None.
Exceptions: TypeError if 'arg' is the wrong type.

Variable Details

__author__

Type:
str
Value:
'Mike Orr <iron@mso.oz.net>'                                           

__revision__

Type:
str
Value:
'1.1'                                                                  

Generated by Epydoc 2.0 on Mon Nov 10 15:08:18 2003 http://epydoc.sf.net