2 # Shared type definitions
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2006 The Trustees of Princeton University
7 # $Id: Parameter.py,v 1.1 2006/09/06 15:36:07 mlhuang Exp $
12 Typed value wrapper. Use in accepts and returns to document method
13 parameters. Set the optional and default attributes for
14 sub-parameters (i.e., dict fields).
17 def __init__(self, type, doc = "", min = None, max = None, optional = True, default = None):
18 (self.type, self.doc, self.min, self.max, self.optional, self.default) = \
19 (type, doc, min, max, optional, default)
22 return repr(self.type)
26 A list (technically, a tuple) of types. Use in accepts and returns
27 to document method parameters that may return mixed types.
30 def __new__(cls, *types):
31 return tuple.__new__(cls, types)