Typescript If Not Empty Python Function Declaration