[issue35634] kwargs regression when there are multiple entries with the same key

2019-01-01 Thread iceboy


New submission from iceboy :

Using the multidict package on pypi to illustrate the problem.

Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multidict
>>> d = multidict.CIMultiDict([('a', 1), ('a', 2)])
>>> def foo(**kwargs): pass
... 
>>> foo(**d)
>>> foo(**{}, **d)

Python 3.6.7 (default, Oct 21 2018, 08:08:16) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import multidict
>>> d = multidict.CIMultiDict([('a', 1), ('a', 2)])
>>> def foo(**kwargs): pass
... 
>>> foo(**d)
>>> foo(**{}, **d)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: foo() got multiple values for keyword argument 'a'

(1) foo(**d)
(2) foo(**{}, **d)

(1) works fine in both versions but (2) only works in Python 3.5 but raises 
TypeError in Python 3.6. This should be a regression. We should either make 
both expressions work or raises error.

--
messages: 332849
nosy: iceboy
priority: normal
severity: normal
status: open
title: kwargs regression when there are multiple entries with the same key
versions: Python 3.6

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



[issue35634] kwargs regression when there are multiple entries with the same key

2019-01-02 Thread iceboy


iceboy  added the comment:

I feel like we should not check the argument and allow overriding. If the 
argument checking is desired, can we also check when there is only a single 
kwargs? Currently `foo(**d)` still works in Python 3.6 with duplicated keys.

--

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



[issue26654] asyncio is not inspecting keyword arguments of functools.partial

2016-03-28 Thread iceboy

New submission from iceboy:

import asyncio
import functools

def foo(x): raise Exception()

loop = asyncio.get_event_loop()
loop.call_soon(functools.partial(foo, x=1))
loop.run_forever()

Current error message:
Exception in callback foo()() at ...:4

Expected error message:
Exception in callback foo(x=1)() at ...:4

--
components: asyncio
messages: 262566
nosy: gvanrossum, haypo, iceboy, yselivanov
priority: normal
severity: normal
status: open
title: asyncio is not inspecting keyword arguments of functools.partial
versions: Python 3.5

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



[issue26654] asyncio is not inspecting keyword arguments of functools.partial

2016-03-29 Thread iceboy

iceboy added the comment:

Created a PR https://github.com/python/asyncio/pull/328. Please review. Thanks.

--

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