阅读背景:

Python:为方法调用添加可选参数的更优雅方式

来源:互联网 

This will seem trivial perhaps, but it is a condition that I run into fairly frequently and would like to find a more elegant way of writing this code. The method, while not terribly relevant to the question, takes a text value and an optional is_checked value to create a radio button (using dominate). In this case, I can't set 'checked' to None, or false - it either has to be there or not. It doesn't seem like I should have to write the 'input' line twice though, just to optionally add an argument.This will seem trivial perhaps, but it is a con




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: