What's a good way to provide additional decoration/metadata for Python function parameters?

后端 未结 4 1561
生来不讨喜
生来不讨喜 2021-02-15 17:17

We\'re considering using Python (IronPython, but I don\'t think that\'s relevant) to provide a sort of \'macro\' support for another application, which controls a piece of equip

4条回答
  •  無奈伤痛
    2021-02-15 18:08

    The 'pythonic' way to do this are function annotations.

    def DoSomething(critical_temp: "temperature", time: "time")
        pass
    

提交回复
热议问题