标签: python-3.x urllib reduce
给出
paths = ("http://localhost:5000", "api", "v1")
我希望
from functools import reduce from urllib.parse import urljoin reduce(urljoin, paths)
屈服
"http://localhost:5000/api/v1"
但实际上会产生
"http://localhost:5000/v1"
这是为什么?