Method: Python::Pickle::Deserializer#copyreg_reconstructor

Defined in:
lib/python/pickle/deserializer.rb

#copyreg_reconstructor(klass, super_class, init_arg) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Implements Python's copyreg._reconstructor function for Python Pickle protocol 0 compatibility.

Parameters:

  • class (PyClass, Class)

    The Python or Ruby class to be initialized.

  • super_class (PyClass)

    The Python super-class of the class.

  • init_arg (Array, nil)

    The argument(s) that will be passed to the class'es new method.



467
468
469
# File 'lib/python/pickle/deserializer.rb', line 467

def copyreg_reconstructor(klass,super_class,init_arg)
  klass.new(*init_arg)
end