小编Lit*_*tty的帖子

python:方法参数的装饰器可能吗?

是否可以修饰方法参数?就像是:

class SampleEntity (BaseEntity) :
    def someOperation (self, @Param(type="int", unit="MB")i, str) :
        pass
Run Code Online (Sandbox Code Playgroud)

基本上我希望开发人员能够指定有关类,属性,方法,参数等的元数据,稍后我们可以处理这些元数据.对于类和方法,我可以使用装饰器.所以我想知道如何为方法参数做这件事.

谢谢,Litty

python methods arguments decorator

3
推荐指数
1
解决办法
187
查看次数

标签 统计

arguments ×1

decorator ×1

methods ×1

python ×1