class

PyCall::PyWrap

Inherits Reference < Object

Constants

OPERATOR_NAMES = { "+": "__add__", "-": "__sub__", "*": "__mul__", "/": "__truediv__", "%": "__mod__", "**": "__pow__", "<<": "__lshift__", ">>": "__rshift__", "&": "__and__", "|": "__or__", "^": "__xor__", }

Дуандеры для операторов, как OPERATOR_METHOD_NAMES в гемме.

Constructors

new(__pyptr__ : Pointer(LibPy::PyObjectT))

Забирает (steals) переданную ссылку — как PyCall::PyPtr в гемме.

Source
wrap(p : Pointer(LibPy::PyObjectT)) : PyWrap

Диспетчеризация по ob_type — аналог register_python_type_mapping.

Source

Instance methods

!=(other) : Bool

Returns true if this object is not equal to other.

By default this method is implemented as !(self == other) so there's no need to override this unless there's a more efficient way to do it.

Source
%(other)
Source
&(other)
Source
*(other)
Source
**(other)
Source
+(other)
Source
-(other)
Source
/(other)
Source
<(other) : Bool
Source
<<(other)
Source
<=(other) : Bool
Source
==(other) : Bool

Returns false (other can only be a Value here).

Source
>(other) : Bool
Source
>=(other) : Bool
Source
>>(other)
Source
[](*keys) : PyValue
Source
[]=(*keys, value) : Object
Source
^(other)
Source
__call_attr(name : String, *args, **kwargs) : PyValue
Source
__call_attr(name : String, *args, **kwargs, &block : Array(PyValue) -> PyValue) : PyValue
Source
__call_attr_impl(name : String, args, kwargs) : PyValue
Source
__getattr_or_call0(name : String) : PyValue
Source
__pyptr__
Source
__setattr(name : String, value)
Source
|(other)
Source
call(*args, **kwargs) : PyValue
Source
call(*args, **kwargs, &block : Array(PyValue) -> PyValue) : PyValue
Source
dup

Returns a shallow copy of this object.

This allocates a new object and copies the contents of self into it.

Source
finalize
Source
hash(hasher)

See Object#hash(hasher)

Source
inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
kind_of_python_type?(py_type : PyWrap) : Bool

kind_of? для python-типов (PyTypeObjectWrapper#kind_of? в гемме)

Source
size
Source
to_a
Source
to_a_of_strings

helper для traceback-строк

Source
to_f
Source
to_i
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
to_unsafe
Source

Macros

method_missing(call)
Source