Commits

Mike Orr committed 1b7bf88

Move ``NotGiven`` to webhelpers.misc.

  • Participants
  • Parent commits af944eb

Comments (0)

Files changed (5)

 tip (development version)
 -------------------------
 
+* webhelpers.containers / webhelpers.misc:
+
+  - ``NotGiven`` moved to webhelpers.misc.
+
 * webhelpers.html.grid / webhelpers.pylonslib.grid:
 
   - Updates by Ergo, including SQLAlchemy grid classes.

File docs/modules/containers.rst

        >> d = defaultdict(int);  d[ANYTHING] += 1
 
 .. autoclass:: DumbObject
-.. autoclass:: NotGiven
 
 Functions
 ---------

File docs/modules/misc.rst

 
 .. currentmodule:: webhelpers.misc
 
+.. autoclass:: NotGiven
+
 .. autofunction:: all(seq[, pred])
 .. autofunction:: any(seq[, pred])
 .. autofunction:: no(seq[, pred])

File webhelpers/containers.py

 
 import sys
 
+from webhelpers.misc import NotGiven
+
 try:
     from collections import defaultdict
 except ImportError:   # Python < 2.5
             return 'defaultdict(%s, %s)' % (self.default_factory,
                                             dict.__repr__(self))
 
-class NotGiven(object):
-    """A default value for function args.
-
-    Use this when you need to distinguish between ``None`` and no value.
-    
-    Example::
-    
-        >>> def foo(arg=NotGiven):
-        ...     print arg is NotGiven
-        ...
-        >>> foo()
-        True
-        >>> foo(None)
-        False
-
-    """
-    pass
-
-
 class DumbObject(object):
     """A container for arbitrary attributes.
 

File webhelpers/misc.py

     return [x for x in it if isinstance(x, class_types) and 
         issubclass(x, class_) and x not in ignore]
 
+
+class NotGiven(object):
+    """A default value for function args.
+
+    Use this when you need to distinguish between ``None`` and no value.
+    
+    Example::
+    
+        >>> def foo(arg=NotGiven):
+        ...     print arg is NotGiven
+        ...
+        >>> foo()
+        True
+        >>> foo(None)
+        False
+
+    """
+    pass
+
+
 class DeclarativeException(Exception):
     """A simpler way to define an exception with a fixed message.