class PyCall::List
Public Instance Methods
<<(item)
click to toggle source
# File lib/pycall/list.rb, line 22 def <<(item) append(item) end
each(&block)
click to toggle source
# File lib/pycall/list.rb, line 16 def each(&block) return enum_for unless block_given? LibPython::Helpers.sequence_each(__pyptr__, &block) self end
include?(item)
click to toggle source
# File lib/pycall/list.rb, line 8 def include?(item) LibPython::Helpers.sequence_contains(__pyptr__, item) end
length()
click to toggle source
# File lib/pycall/list.rb, line 12 def length PyCall.len(self) end
push(*items)
click to toggle source
# File lib/pycall/list.rb, line 26 def push(*items) items.each {|i| append(i) } end
sort()
click to toggle source
# File lib/pycall/list.rb, line 30 def sort dup.sort! end
sort!()
click to toggle source
# File lib/pycall/list.rb, line 34 def sort! LibPython::Helpers.getattr(__pyptr__, :sort).__call__ self end
to_a()
click to toggle source
# File lib/pycall/list.rb, line 39 def to_a Array.new(length) {|i| self[i] } end
Also aliased as: to_ary