def checkSubstitute(self, typecode):
if not isinstance(typecode, ElementDeclaration): <EOL><INDENT>return False<EOL><DEDENT>try:<EOL><INDENT>nsuri,ncname = typecode.substitutionGroup<EOL><DEDENT>except (AttributeError, TypeError):<EOL><INDENT>return False<EOL><DEDENT>if (nsuri,ncname) != (self.schema,self.literal):<EOL><INDENT>if not nsuri and not self.schema and ncname == self.literal:<EOL><INDENT>return True<EOL><DEDENT>return False<EOL><DEDENT>sub = GED(self.schema, self.literal)<EOL>if sub is None or sub is not typecode:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
If this is True, allow typecode to be substituted
        for "self" typecode.