저는 여전히 파이썬을 처음 접했습니다. 데코레이터가있는 함수가 주어지면 함수가 해당 데코레이터에 액세스 할 수 있습니까?파이썬 - 함수가 자체 데코레이터를 볼 수 있습니까?
@task
@roles('qa-env')
def deploy_qa():
#-----------------------------------------------------------------------
# Is there a way to get access to the @roles decorator as an array here?
#-----------------------------------------------------------------------
deployer.configureEnv('qa-env')
deployer.installApp1()
deployer.installApp2(True)
와우! 나는'sys._getFrame (1)'에 대해 몰랐다. 잘 알고 있습니다. 너 +1 했어. – Chandranshu