我没有在任何风格指南中看到它。我应该组合类似的异常类型还是将它们分成不同的行:
"""
This is a Google style docs.
...
...
Raises:
TypeError: foo() missing 1 required positional argument. Key must be a numeric value.
KeyError: bar
"""
或者这个:
"""
This is a Google style docs.
...
...
Raises:
TypeError: foo() missing 1 required positional argument
TypeError: key must be a numeric value
KeyError: bar
"""
答案 0 :(得分:0)
我认为第二步。
"""
This is a Google style docs.
...
...
Raises:
TypeError: 1. foo() missing 1 required positional argument.
2. key must be a numeric value.
3. ...
KeyError: 1. bar key is missing.
2. ...
"""