我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用System.ParamArrayAttribute()。
def get_ipy_sig(self, obj, ctor): args = [] vargs = None varkw = None defaults = [] for param in ctor.GetParameters(): if param.IsDefined(ParamArrayAttribute, False): vargs = param.Name elif param.IsDefined(ParamDictionaryAttribute, False): varkw = param.Name else: args.append(param.Name) if param.DefaultValue is not DBNull.Value: defaults.append(repr(param.DefaultValue)) return obj.__doc__, args, vargs, varkw, tuple(defaults)