title: dill/pickle issue with built-in function
body: <p>When using <code>dill</code> to serialize a class:</p>
  
  <pre><code>import dill, pickle
  
  class project(object):
      def __init__(self, name='', folder='', user_id='', version=-1 ):
          self.name, self.folder, self.user_id, self.version = name, folder, user_id, version
  # Other code, not shown, since Big class .......
  
  dill.dump(proj1, open('test_dill.pkl', 'w'), byref=False )
  </code></pre>
  
  <p>I get this message :</p>
  
  <pre class="lang-none prettyprint-override"><code>PicklingError: Can't pickle &lt;built-in function raw_input&gt;: it's not the same object as __builtin__.raw_input
  
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 236, in dump
      pik.dump(obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 224, in dump
      self.save(obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 401, in save_reduce
      save(args)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 554, in save_tuple
      save(element)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 401, in save_reduce
      save(args)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 554, in save_tuple
      save(element)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 401, in save_reduce
      save(args)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 554, in save_tuple
      save(element)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 401, in save_reduce
      save(args)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 554, in save_tuple
      save(element)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 606, in save_list
      self._batch_appends(iter(obj))
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 642, in _batch_appends
      save(tmp[0])
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 331, in save
      self.save_reduce(obj=obj, *rv)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 425, in save_reduce
      save(state)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 835, in save_module_dict
      StockPickler.save_dict(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 655, in save_dict
      self._batch_setitems(obj.iteritems())
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 687, in _batch_setitems
      save(v)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 286, in save
      f(self, obj) # Call unbound method with explicit self
  
    File "D:\_devs\Python01\Anaconda27\lib\site-packages\dill\dill.py", line 993, in save_builtin_method
      StockPickler.save_global(pickler, obj)
  
    File "D:\_devs\Python01\Anaconda27\lib\pickle.py", line 759, in save_global
      (obj, module, name))
  
  PicklingError: Can't pickle &lt;built-in function raw_input&gt;: it's not the same object as __builtin__.raw_input
  </code></pre>
  
  <p>Am not sure than built-in functions can be modified by the code...<br>
  It sounds mysterious.</p>