Estoy tratando de formar URL de diferentes piezas, y tengo problemas para entender el comportamiento de este método. Por ejemplo:Python: confusiones con urljoin
3.x Python
from urllib.parse import urljoin
>>> urljoin('some', 'thing')
'thing'
>>> urljoin('http://some', 'thing')
'http://some/thing'
>>> urljoin('http://some/more', 'thing')
'http://some/thing'
>>> urljoin('http://some/more/', 'thing') # just a tad/after 'more'
'http://some/more/thing'
urljoin('http://some/more/', '/thing')
'http://some/thing'
Puede explicar el comportamiento exacto de este método?
Nota para los que se encuentran con esta pregunta: la declaración de importación anterior es para Python 3.x. Utilice "from urlparse import urljoin" para python 2.x. –