3 ms·
Named parameters are nice in this case, e.g. in Python def calc_formula(a, b, is_gain=False): ... calc(a, b, is_gain=True)
by riquito 11y ago
Named parameters are nice in this case, e.g. in Python
def calc_formula(a, b, is_gain=False):
...
calc(a, b, is_gain=True)
- moreati 11y agoAlso worth mentioning that Python 3 supports keyword only parameters, which enforce this calling styling http://blog.gahooa.com/2009/12/08/python-has-keyword-only-parameters/ http://blog.gahooa.com/2009/12/08/python-has-keyword-only-pa... e.g. def calc_formula(a, b, *, is_gain=False): ...
- deleted 11y ago[deleted]