Module: PyBind::TypeCast
- Defined in:
- lib/pybind/typecast.rb
Class Method Summary collapse
Class Method Details
.from_python(pyobj) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/pybind/typecast.rb', line 3 def self.from_python(pyobj) pystruct = pyobj.to_python_struct return nil if pystruct.null? || pystruct.none? Types.pytypes.each do |pytype| return pytype.from_python(pystruct) if pytype.python_instance?(pystruct) end PyObject.from_python(pystruct) end |