출처 : https://github.com/toml-lang/toml/blob/6de8059654ea82c895522345111d5848bd8e94c5/scripts/release.py#L85
_INDENT = 0
...
def log(message: str, *, error=False) -> None:
output = textwrap.indent(message, " " * _INDENT)
if error:
file = sys.stderr
# A dash of red
if sys.stdout.isatty():
output = f"\033[31m{output}\033[0m"
else:
file = sys.stdout
print(output, file=file)
함수 내부 보면
곱하기로 사용하고 있음
* 의미가 인자 여러개라면
왜 문자열과 전역 변수 중간에 있음?
곱하기 아님?
인자 여러개라는 뜻 아닌데? 이 이후로는 이름 써야된다는 뜻임
이름을 안적으면 싹다 *, 이름없는 가변인자에 들어가게 되니까 그걸 이용한 트릭이지 * 자체는 인자 여러개가 맞음
지금까지 *만 있는 거랑 *abc랑 다른 문법이라 생각했는데 *는 그냥 이름없는 가변인자라고 생각하면 되는 거였네ㄷㄷㄷ