class Crython::PyObject
- Crython::PyObject
- Reference
- Object
Overview
Extension methods for PyObject
Included Modules
- Crython::ObjectProtocol
Defined in:
crython/py2cr/basic.crcrython/py2cr/collections.cr
crython/pyobject.cr
Constructors
Macro Summary
Instance Method Summary
- #!=(other : PyObject) : PyObject
-
#!=(other) : PyObject
Returns
true
if this object is not equal to other. - #%(other : PyObject) : PyObject
- #%(other) : PyObject
- #*(other : PyObject) : PyObject
- #*(other) : PyObject
- #**(other : PyObject) : PyObject
- #**(other) : PyObject
- #+(other : PyObject) : PyObject
- #+(other) : PyObject
- #-(other : PyObject) : PyObject
- #-(other) : PyObject
- #/(other : PyObject) : PyObject
- #/(other) : PyObject
- #//(other : PyObject) : PyObject
- #//(other) : PyObject
- #<(other : PyObject) : PyObject
- #<(other) : PyObject
- #<=(other : PyObject) : PyObject
- #<=(other) : PyObject
- #==(other : PyObject) : PyObject
-
#==(other) : PyObject
Returns
false
(other can only be aValue
here). - #>(other : PyObject) : PyObject
- #>(other) : PyObject
- #>=(other : PyObject) : PyObject
- #>=(other) : PyObject
- #[](*key) : PyObject
- #[]=(key, value) : Nil
- #call(call : String | Symbol, *args, **kwargs) : PyObject
- #finalize
-
#get_type_name : String
Helper method to get Python object type name
- #inspect(io) : Nil
- #need_decref : Bool
- #need_decref=(need_decref : Bool)
-
#raw : Pointer(Void)
Access the raw Python object pointer
-
#to_a(element_type : T.class) : Array(T) forall T
Convert to Crystal Array
-
#to_b : Bool
Convert to Crystal Bool
-
#to_complex : Complex
Convert Python complex to Crystal Complex
-
#to_cr
Convert to appropriate Crystal type
-
#to_dict : Hash(PyObject, PyObject)
Convert Python dict to Crystal Hash(PyObject, PyObject)
-
#to_f64 : Float64
Convert to Crystal Float64
-
#to_h(key_type : K.class, value_type : V.class) : Hash(K, V) forall K, V
Convert to Crystal Hash
-
#to_i32 : Int32
Convert to Crystal Int32
-
#to_i64 : Int64
Convert to Crystal Int64
-
#to_list : Array(PyObject)
Convert Python list to Crystal Array(PyObject)
- #to_py : PyObject
-
#to_s(io : IO) : Nil
Convert to Crystal String
- #to_s(io) : Nil
-
#to_tuple : Array(PyObject)
Convert Python tuple to Crystal Array(PyObject)
Instance methods inherited from module Crython::ObjectProtocol
<=>(other : ObjectProtocol)
<=>,
attr(attr : String) : PyObject
attr,
callable? : Bool
callable?,
del_attr(attr : String) : Bool
del_attr,
has_attr?(attr : String) : Bool
has_attr?,
set_attr(attr : String, obj : ObjectMethods)
set_attr,
to_unsafe
to_unsafe
Constructor Detail
Macro Detail
Instance Method Detail
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.
Returns false
(other can only be a Value
here).
Convert Python dict to Crystal Hash(PyObject, PyObject)
Convert to Crystal Hash