def is_attr_protected(attrname):
 return ((attrname[0] == '_') and (not (attrname == '_')) and (not (attrname.startswith('__') and attrname.endswith('__'))))

def is_attr_protected ( attrname ) : return ( ( attrname [ 0 ] == '_' ) and ( not ( attrname == '_' ) ) and ( not ( attrname . startswith ( '__' ) and attrname . endswith ( '__' ) ) ) )
return true if attribute name is protected .