[issue31706] urlencode should accept generator as values for mappings when doseq=True

2019-08-25 Thread Tal Einat


Tal Einat  added the comment:

IMO the benefit here is very small and not worth the added complexity 
(implementation + tests + docs + maintenance).

--
nosy: +taleinat

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2018-05-02 Thread François Freitag

Change by François Freitag :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2017-11-24 Thread François Freitag

François Freitag  added the comment:

I updated the PR to allow any iterable of two-elements iterables to be passed 
to urlencode.

If anyone has the time and interest, the PR is ready for review.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2017-10-06 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Extending urlencode() to accept iterables instead of just sequences of values 
makes sense to me. There is no principal reason of requiring sequences. But you 
need to update the documentation, docstrings and comments.

While we are here, we can generalize urlencode() in other aspect. Currently it 
accepts either mapping or a sequence of 2-tuples. It could be accept an 
iterable of 2-tuples (or even an iterable of 2-element sequences or 2-element 
iterables).

--
nosy: +serhiy.storchaka
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2017-10-05 Thread François Freitag

Change by François Freitag :


--
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2017-10-05 Thread François Freitag

Change by François Freitag :


--
keywords: +patch
pull_requests: +3872
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2017-10-05 Thread François Freitag

New submission from François Freitag :

The urlencode documentation states that:
The value element in itself can be a sequence and in that case, if the optional 
parameter doseq is evaluates to True, individual key=value pairs separated by 
'&' are generated for each element of the value sequence for the key.

Passing a generator as the value gives unexpected results:
>>> from urllib.parse import urlencode
>>> def gen():
... yield from range(2)
>>> urlencode({'a': gen()}, doseq=True)
'a=%3Cgenerator+object+gen+at+0x7f35ff78db48%3E'

A list gives:
>>> urlencode({'a': [0, 1]}, doseq=True)
'a=0=1'

--
components: Library (Lib)
messages: 303784
nosy: freitafr
priority: normal
severity: normal
status: open
title: urlencode should accept generator as values for mappings when doseq=True
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com