Jukka Lehtosalo
276d0428b9
Avoid false positivies from urlparse (Python 2) (#4437)
PR #3887 changed some `str` types to `Union[str, unicode]`. The `str`
types were too narrow, but the new types are too general, resulting in
around 80 false positives in a Dropbox internal repository.
I think that it's better to narrow down the types back some to avoid
the false positives, as these are commonly used functions.
Test cases:
```
from urlparse import urlunparse, urlunsplit, urljoin, urlparse, urlsplit
reveal_type(urlunparse(('1', '2', '3', '4', '5', '6'))) # str
reveal_type(urlunparse(['1', '2', '3', '4', '5', '6'])) # str
reveal_type(urlunparse((u'1', '2', '3', '4', '5', '6'))) # unicode
reveal_type(urlunparse([u'1', '2', '3', '4', '5', '6'])) # unicode
reveal_type(urlunsplit(('1', '2', '3', '4', '5'))) # str
reveal_type(urlunsplit(['1', '2', '3', '4', '5'])) # str
reveal_type(urlunsplit((u'1', '2', '3', '4', '5'))) # unicode
reveal_type(urlunsplit([u'1', '2', '3', '4', '5'])) # unicode
reveal_type(urljoin('x', 'y')) # str
reveal_type(urljoin(u'x', 'y')) # unicode
reveal_type(urljoin('x', u'y')) # unicode
reveal_type(urlparse('x').path) # str
reveal_type(urlparse(u'x').path) # str
reveal_type(urlparse(u'x').username) # Optional[str]
reveal_type(urlsplit('x').path) # str
reveal_type(urlsplit(u'x').path) # str
```
2020-08-11 13:03:06 +01:00
..
2016-10-26 16:24:49 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-30 11:40:25 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-02 14:08:54 -07:00
2019-04-13 10:40:52 +02:00
2019-04-13 10:40:52 +02:00
2019-04-13 10:40:52 +02:00
2019-04-13 10:40:52 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-10-13 16:22:03 -07:00
2020-08-08 20:49:37 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-08-05 17:35:22 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-08-10 15:55:32 +01:00
2019-10-01 05:31:34 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2018-03-17 22:22:25 -07:00
2018-03-05 12:42:29 -08:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2017-02-22 20:15:35 -08:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-04-13 10:40:52 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-07-31 15:45:50 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2018-02-22 09:05:06 -08:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-08-10 12:52:13 +01:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2017-04-30 14:16:30 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2019-04-13 10:40:52 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-04-13 10:40:52 +02:00
2016-10-26 16:24:49 -07:00
2019-04-13 10:40:52 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-04-13 10:40:52 +02:00
2020-06-28 13:31:00 -07:00
2019-10-20 10:37:33 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-10-13 21:51:43 +02:00
2020-06-28 13:31:00 -07:00
2019-04-13 10:40:52 +02:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2019-10-13 16:22:03 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-08-11 13:03:06 +01:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2017-10-06 19:04:18 -07:00
2020-06-28 13:31:00 -07:00