Merge "Add choices parameter for IntOpt class"
This commit is contained in:
commit
42075a4638
@ -1015,15 +1015,26 @@ class IntOpt(Opt):
|
|||||||
:param name: the option's name
|
:param name: the option's name
|
||||||
:param min: minimum value the integer can take
|
:param min: minimum value the integer can take
|
||||||
:param max: maximum value the integer can take
|
:param max: maximum value the integer can take
|
||||||
|
:param choices: Optional sequence of either valid values or tuples of valid
|
||||||
|
values with descriptions.
|
||||||
:param \*\*kwargs: arbitrary keyword arguments passed to :class:`Opt`
|
:param \*\*kwargs: arbitrary keyword arguments passed to :class:`Opt`
|
||||||
|
|
||||||
.. versionchanged:: 1.15
|
.. versionchanged:: 1.15
|
||||||
|
|
||||||
Added *min* and *max* parameters.
|
Added *min* and *max* parameters.
|
||||||
|
|
||||||
|
|
||||||
|
.. versionchanged:: 9.3.0
|
||||||
|
|
||||||
|
Added *choices* parameter.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, min=None, max=None, **kwargs):
|
def __init__(self, name, min=None, max=None, choices=None, **kwargs):
|
||||||
super(IntOpt, self).__init__(name, type=types.Integer(min, max),
|
super(IntOpt, self).__init__(name,
|
||||||
|
type=types.Integer(
|
||||||
|
min=min,
|
||||||
|
max=max,
|
||||||
|
choices=choices),
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Add choice parameter for IntOpt class for conformity with types.Integer.
|
Loading…
x
Reference in New Issue
Block a user