Method: Python::Pickle::Deserializer#resolve_constant

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

#resolve_constant(namespace, name) ⇒ Class, ...

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.

Resolves a constant that exists in a Python namespace.

Parameters:

  • namespace (String)

    The namespace name.

  • name (String)

    The name of the constant within the namespace.

Returns:

  • (Class, PyClass, Method, nil)

    The resolved class or method.



483
484
485
486
487
488
489
# File 'lib/python/pickle/deserializer.rb', line 483

def resolve_constant(namespace,name)
  constant = if (mod = @constants[namespace])
               mod[name]
             end

  return constant || PyClass.new(namespace,name)
end