Sha256: 88fd4cd4b16007884385e9120d7389641b568206c5227af5fac53fb03a53baff

Contents?: true

Size: 596 Bytes

Versions: 10

Compression:

Stored size: 596 Bytes

Contents

module PyCall
  module Types
    def self.pyisinstance(pyobj, pytype)
      pyobj = LibPython::PyObjectStruct.new(pyobj) if pyobj.kind_of? FFI::Pointer
      pyobj = pyobj.__pyobj__ unless pyobj.kind_of? LibPython::PyObjectStruct

      pytype = LibPython::PyObjectStruct.new(pytype) if pytype.kind_of? FFI::Pointer
      pytype = ptype.__pyobj__ unless pytype.kind_of? LibPython::PyObjectStruct

      LibPython.PyObject_IsInstance(pyobj, pytype) == 1
    end

    class << self
      private def check_pyobject(pyobj)
        # TODO: Check whether pyobj is PyObject
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pycall-0.1.0.alpha.20170711 lib/pycall/types.rb
pycall-0.1.0.alpha.20170502 lib/pycall/types.rb
pycall-0.1.0.alpha.20170426 lib/pycall/types.rb
pycall-0.1.0.alpha.20170419b lib/pycall/types.rb
pycall-0.1.0.alpha.20170419a lib/pycall/types.rb
pycall-0.1.0.alpha.20170419 lib/pycall/types.rb
pycall-0.1.0.alpha.20170403 lib/pycall/types.rb
pycall-0.1.0.alpha.20170329 lib/pycall/types.rb
pycall-0.1.0.alpha.20170317 lib/pycall/types.rb
pycall-0.1.0.alpha.20170311 lib/pycall/types.rb