HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/hamcrest/core/core/isnone.py
from __future__ import absolute_import
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"

from hamcrest.core.base_matcher import BaseMatcher
from .isnot import is_not


class IsNone(BaseMatcher):

    def _matches(self, item):
        return item is None

    def describe_to(self, description):
        description.append_text('None')


def none():
    """Matches if object is ``None``."""
    return IsNone()


def not_none():
    """Matches if object is not ``None``."""
    return is_not(none())