[pypy-issue] Issue #2043: functools.partial doesn't behave the same way under CPython and PyPy when not given arguments (pypy/pypy)

Max Grender-Jones issues-reply at bitbucket.org
Sat May 9 02:58:39 CEST 2015


New issue 2043: functools.partial doesn't behave the same way under CPython and PyPy when not given arguments
https://bitbucket.org/pypy/pypy/issue/2043/functoolspartial-doesnt-behave-the-same

Max Grender-Jones:

If no keyword arguments are provided, `keywords` should be an empty `dict` not `None`
```
$ python
Python 2.7.9 (default, Apr  7 2015, 07:58:25) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from functools import partial
>>> partial(int, *[1], **{}).keywords
{}
```
vs
```
$ pypy
Python 2.7.9 (9c4588d731b7fe0b08669bd732c2b676cb0a8233, Mar 31 2015, 07:55:22)
[PyPy 2.5.1 with GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>> from functools import partial
>>>> partial(int, *[1], **{}).keywords
>>>>
```




More information about the pypy-issue mailing list