2 # Shared type definitions
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2006 The Trustees of Princeton University
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 = "", optional = True, default = None):
18 (self.type, self.doc, self.optional, self.default) = \
19 (type, doc, 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)