From 492996b6461f39068e52504c4b65bf39edfbc44c Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Wed, 3 Jul 2019 15:43:42 +0100 Subject: _yaml: Remove 'is_node', which is not used in the codebase anymore A direct replacement would be isinstance(obj, MappingNode) if someone really needs it. --- src/buildstream/_yaml.pyx | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx index 6420474eb..3dbf7bfea 100644 --- a/src/buildstream/_yaml.pyx +++ b/src/buildstream/_yaml.pyx @@ -1137,26 +1137,6 @@ def node_extend_list(Node node, str key, Py_ssize_t length, object default): the_list.append(_create_node(value, file_index, line_num, next_synthetic_counter())) -# is_node() -# -# A test method which returns whether or not the passed in value -# is a valid YAML node. It is not valid to call this on a Node -# object which is not a Mapping. -# -# Args: -# maybenode (any): The object to test for nodeness -# -# Returns: -# (bool): Whether or not maybenode was a Node -# -def is_node(maybenode): - # It's a programming error to give this a Node which isn't a mapping - # so assert that. - assert (type(maybenode) not in [ScalarNode, SequenceNode]) - # Now return the type check - return type(maybenode) is MappingNode - - # new_synthetic_file() # # Create a new synthetic mapping node, with an associated file entry -- cgit v1.2.1