From b0a93d57a01d798ff3f03e9c718dfd9c3b72af58 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Fri, 2 Sep 2016 13:33:55 -0400 Subject: [PATCH] DOC: Clarify expect_bounded docstring. --- zipline/utils/input_validation.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zipline/utils/input_validation.py b/zipline/utils/input_validation.py index dfde4fbd..c672ebea 100644 --- a/zipline/utils/input_validation.py +++ b/zipline/utils/input_validation.py @@ -505,8 +505,13 @@ def expect_element(*_pos, **named): def expect_bounded(**named): """ - Preprocessing decorator that verifies inputs fall between upper and lower - bounds. + Preprocessing decorator verifying that inputs fall between bounds. + + Bounds should be passed as a pair of ``(min_value, max_value)``. Both + bounds are checked inclusively. + + ``None`` may be passed as ``min_value`` or ``max_value`` to signify that + the input is only bounded above or below. Usage ----- @@ -524,11 +529,6 @@ def expect_bounded(**named): ValueError: ...foo() expected a value between 1 and 5 for argument 'x', but got 6 instead. - Notes - ----- - None can be passed as the lower or upper bound to signify that a value only - has an upper or lower bound. - >>> @expect_bounded(x=(2, None)) ... def foo(x): ... return x