Message387756
| Author | gregory.p.smith |
|---|---|
| Recipients | AdamGold, eric.araujo, gregory.p.smith, kj, lemburg, lukasz.langa, mcepl, ned.deily, orsenthil, serhiy.storchaka, vstinner |
| Date | 2021-02-27.00:59:33 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1614387573.54.0.604270147273.issue42967@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
An example code snippet to detect if the API supports the new parameter at runtime for code that wants to use to use something other than the default '&'.
```
if 'separator' in inspect.signature(urllib.parse.parse_qs).parameters:
... parse_qs(..., separator=';')
else:
... parse_qs(...)
```
calling it with the arg and catching TypeError if that fails would also work, but might not be preferred as catching things like TypeError is non-specific and could hide other problems, making it a code maintenance headache. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2021-02-27 00:59:34 | gregory.p.smith | set | recipients: + gregory.p.smith, lemburg, orsenthil, vstinner, ned.deily, mcepl, eric.araujo, lukasz.langa, serhiy.storchaka, kj, AdamGold |
| 2021-02-27 00:59:33 | gregory.p.smith | set | messageid: <1614387573.54.0.604270147273.issue42967@roundup.psfhosted.org> |
| 2021-02-27 00:59:33 | gregory.p.smith | link | issue42967 messages |
| 2021-02-27 00:59:33 | gregory.p.smith | create | |