def matches(s: 'Symbol') -> bool:
    if (s.identOrOp != identOrOp):
        return False
    if ((s.templateParams is None) != (templateParams is None)):
        if (templateParams is not None):
            return False
        if (not templateShorthand):
            return False
    if templateParams:
        if (str(s.templateParams) != str(templateParams)):
            return False
    if ((s.templateArgs is None) != (templateArgs is None)):
        return False
    if s.templateArgs:
        if (str(s.templateArgs) != str(templateArgs)):
            return False
    return True
def matches(s: 'Symbol') -> bool:
    if (s.identOrOp != identOrOp):
        return False
    if ((s.templateParams is None) != (templateParams is None)):
        if (templateParams is not None):
            return False
        if (not templateShorthand):
            return False
    if templateParams:
        if (str(s.templateParams) != str(templateParams)):
            return False
    if ((s.templateArgs is None) != (templateArgs is None)):
        return False
    if s.templateArgs:
        if (str(s.templateArgs) != str(templateArgs)):
            return False
    return True