""" Commonly useful converters. """ from __future__ import absolute_import, division, print_function def optional(converter): """ A converter that allows an attribute to be optional. An optional attribute is one which can be set to ``None``. :param callable converter: the converter that is used for non-``None`` values. .. versionadded:: 17.1.0 """ def optional_converter(val): if val is None: return None return converter(val) return optional_converter
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 1.13 KB | 0644 |
|
_compat.py | File | 4.19 KB | 0644 |
|
_config.py | File | 514 B | 0644 |
|
_funcs.py | File | 7.71 KB | 0644 |
|
_make.py | File | 48.14 KB | 0644 |
|
converters.py | File | 531 B | 0644 |
|
exceptions.py | File | 1.08 KB | 0644 |
|
filters.py | File | 1.12 KB | 0644 |
|
validators.py | File | 4.84 KB | 0644 |
|