Class: PyCall::LibPython::PyObjectStruct

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/pycall/libpython/pyobject_struct.rb,
lib/pycall/libpython/pyobject_struct.rb

Direct Known Subclasses

PyTypeObjectStruct

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nullObject



15
16
17
# File 'lib/pycall/libpython/pyobject_struct.rb', line 15

def self.null
  new(FFI::Pointer::NULL)
end

Instance Method Details

#kind_of?(klass) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'lib/pycall/libpython/pyobject_struct.rb', line 23

def kind_of?(klass)
  klass = klass.__pyobj__ if klass.kind_of? PyObjectWrapper
  return super unless klass.kind_of? PyObjectStruct
  PyCall::Types.pyisinstance(self, klass)
end

#py_none?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/pycall/libpython/pyobject_struct.rb', line 19

def py_none?
  PyCall.none?(self)
end