summaryrefslogtreecommitdiff
path: root/jsonschema/_utils.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-08-18 18:15:07 +0100
committerJulian Berman <Julian@GrayVines.com>2021-08-18 18:15:07 +0100
commit00031cb043763842266877923552e40f0c8f36b5 (patch)
treea7ff84ca2244b7832f857f4715b324576ef3a604 /jsonschema/_utils.py
parenteb633b216bad1acb1a7739279c5ab83bdd63d7a1 (diff)
downloadjsonschema-00031cb043763842266877923552e40f0c8f36b5.tar.gz
Remove types_msg which implements really old draft-3 behavior.
Since then, types aren't objects, they're just strings. This just wastes time catching exceptions for newer drafts.
Diffstat (limited to 'jsonschema/_utils.py')
-rw-r--r--jsonschema/_utils.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py
index 0af7355..54f9c22 100644
--- a/jsonschema/_utils.py
+++ b/jsonschema/_utils.py
@@ -120,25 +120,6 @@ def extras_msg(extras):
return ", ".join(repr(extra) for extra in extras), verb
-def types_msg(instance, types):
- """
- Create an error message for a failure to match the given types.
-
- If the ``instance`` is an object and contains a ``name`` property, it will
- be considered to be a description of that object and used as its type.
-
- Otherwise the message is simply the reprs of the given ``types``.
- """
-
- reprs = []
- for type in types:
- try:
- reprs.append(repr(type["name"]))
- except Exception:
- reprs.append(repr(type))
- return f"{instance!r} is not of type {', '.join(reprs)}"
-
-
def flatten(suitable_for_isinstance):
"""
isinstance() can accept a bunch of really annoying different types: