|
if cst_param.default is not None: |
|
# TODO: parameter default |
|
logging.warning("parameter default values not implemented") |
|
{#- TODO: default value -#} |
We should make an attempt to display (or at least indicate) that there is a default value for named parameters. For example, the following loses the =1 after rendering:
The smallest improvement we can make here would be to render an ellipsis:
The best version of this would be to actually render the default value. Unfortunately, this is non-trivial. For example, this is valid:
def a(b=[str(x + 50) for x in [1, 2, 3]]):
print(b)
Perhaps for simple values/literals, we render them, but for more complex ones we leave them out?
docc/src/docc/plugins/python/cst.py
Lines 667 to 669 in f5e919e
docc/src/docc/plugins/python/templates/html/parameter.html
Line 24 in f5e919e
We should make an attempt to display (or at least indicate) that there is a default value for named parameters. For example, the following loses the
=1after rendering:The smallest improvement we can make here would be to render an ellipsis:
The best version of this would be to actually render the default value. Unfortunately, this is non-trivial. For example, this is valid:
Perhaps for simple values/literals, we render them, but for more complex ones we leave them out?