def nomethod(cls):
 ctx.status = '405 Method Not Allowed'
 header('Content-Type', 'text/html')
 header('Allow', ', '.join([method for method in ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'] if hasattr(cls, method)]))
 return output('method not allowed')

def nomethod ( cls ) : ctx . status = '405 Method Not Allowed' header ( 'Content-Type' , 'text/html' ) header ( 'Allow' , ', ' . join ( [ method for method in [ 'GET' , 'HEAD' , 'POST' , 'PUT' , 'DELETE' ] if hasattr ( cls , method ) ] ) ) return output ( 'method not allowed' )
returns a 405 method not allowed error for cls .