uqfoundation/dill — pull request #46 by matsjoyce (2014-06-04 16:13:37+00:00)
Title: Fix pickling of partials when there are no kwargs

Fixes errors in the form:
```pycon
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools, dill
>>> def f(a, b, c): pass
...
>>> g = functools.partial(f, 1, 2)
>>> dill.copy(g)
(, TypeError('type object argument after ** must be a mapping, not NoneType',), )
(, , (1, 2), None)
Traceback (most recent call last):
File "", line 1, in
File "/home/matthew/GitHub/dill/dill/dill.py", line 127, in copy
return loads(dumps(obj, *args, **kwds))
File "/home/matthew/GitHub/dill/dill/dill.py", line 160, in loads
return load(file)
File "/home/matthew/GitHub/dill/dill/dill.py", line 150, in load
obj = pik.load()
File "/usr/lib/python3.4/pickle.py", line 1036, in load
dispatch[key[0]](self)
File "/usr/lib/python3.4/pickle.py", line 1382, in load_reduce
value = func(*args)
File "/home/matthew/GitHub/dill/dill/dill.py", line 313, in _create_ftype
return ftypeobj(func, *args, **kwds)
TypeError: type object argument after ** must be a mapping, not NoneType
>>>
```
This occurs when there are no kwargs. Tested with python 2.7 and 3.4.