PyCall::PyWrap
Constants
OPERATOR_NAMES = {
"+": "__add__",
"-": "__sub__",
"*": "__mul__",
"/": "__truediv__",
"%": "__mod__",
"**": "__pow__",
"<<": "__lshift__",
">>": "__rshift__",
"&": "__and__",
"|": "__or__",
"^": "__xor__",
}
Дуандеры для операторов, как OPERATOR_METHOD_NAMES в гемме.
Constructors
Забирает (steals) переданную ссылку — как PyCall::PyPtr в гемме.
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.
%(other)
Source&(other)
Source*(other)
Source**(other)
Source+(other)
Source-(other)
Source/(other)
Source<<(other)
Source>>(other)
Source[](*keys) : PyValue
Source^(other)
Source__pyptr__
Source|(other)
Sourcecall(*args, **kwargs) : PyValue
Sourcedup
Returns a shallow copy of this object.
This allocates a new object and copies the contents of
self into it.
finalize
SourceAppends 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>
kind_of? для python-типов (PyTypeObjectWrapper#kind_of? в гемме)
size
Sourceto_a
Sourceto_f
Sourceto_i
SourceAppends 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>
to_unsafe
SourceMacros
method_missing(call)
Source