basic.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:properties 作者: aranzgeo 项目源码 文件源码
def validate(self, instance, value):                                       #pylint: disable=unused-argument,no-self-use
        """Check if the value is valid for the Property

        If valid, return the value, possibly coerced from the input value.
        If invalid, a ValueError is raised.

        .. warning::

            Calling :code:`validate` again on a coerced value must not modify
            the value further.

        .. note::

            This function should be able to handle :code:`instance=None`
            since valid Property values are independent of containing
            HasProperties class. However, the instance is passed to
            :code:`error` for a more verbose error message, and it may be
            used for additional optional validation.
        """
        return value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号