Documentation ¶
Overview ¶
Right now golang doesn't have support map[] keying with complex types In ideal world I would prefer map[PyObject]PyObject as dictionary backend, but PyInt, PyTuple and PySet contains arrays in their implementation.
This implementation isn't optimized from perfomance/memory perspective and can be done in much more efficient manner.
Index ¶
- Variables
- func GetPyHashSeed() *maphash.Seed
- func PyHashImplementation(obj PyObject) (int64, error)
- func PyPrintImplementation(args PyObject, sep PyObject, end PyObject, file PyObject, flush *PyBool)
- type NoneType
- type PyBinaryAdd
- type PyBinarySubstract
- type PyBool
- func (self *PyBool) BinaryAdd(b PyObject) PyObject
- func (self *PyBool) BinarySubstract(b PyObject) PyObject
- func (self *PyBool) Equal(b PyObject) *PyBool
- func (self *PyBool) Hash() (int64, error)
- func (self *PyBool) IntValue() *PyInt
- func (self *PyBool) Repr() string
- func (self *PyBool) String() string
- type PyDict
- type PyDictKeyValue
- type PyFloat
- type PyFunction
- type PyGetItem
- type PyInt
- type PyIterable
- type PyIterator
- type PyList
- func (self *PyList) Append(value PyObject)
- func (self *PyList) BinaryAdd(b PyObject) PyObject
- func (self *PyList) Equal(b PyObject) *PyBool
- func (self *PyList) Extend(value PyIterable)
- func (self *PyList) GetItem(index PyObject) (PyObject, error)
- func (self *PyList) Hash() (int64, error)
- func (self *PyList) Iter() PyIterator
- func (self *PyList) Pop() PyObject
- func (self *PyList) PopN(n int) []PyObject
- func (self *PyList) Repr() string
- func (self *PyList) SetItem(index PyObject, value PyObject) error
- func (self *PyList) String() string
- type PyListIterator
- type PyObject
- type PySetItem
- type PyString
- type PyStringIterator
- func (self *PyStringIterator) Equal(other PyObject) *PyBool
- func (self *PyStringIterator) Hash() (int64, error)
- func (self *PyStringIterator) Iter() PyIterator
- func (self *PyStringIterator) Next() (PyObject, error)
- func (self *PyStringIterator) Repr() string
- func (self *PyStringIterator) String() string
- type PyTuple
- func (self *PyTuple) BinaryAdd(b PyObject) PyObject
- func (self *PyTuple) Equal(b PyObject) *PyBool
- func (self *PyTuple) GetItem(index PyObject) (PyObject, error)
- func (self *PyTuple) Hash() (int64, error)
- func (self *PyTuple) Iter() PyIterator
- func (self *PyTuple) Repr() string
- func (self *PyTuple) String() string
- type PyTupleIterator
Constants ¶
This section is empty.
Variables ¶
View Source
var Builtin = map[string]PyObject{ "print": &PyFunction{ Callable: PyPrint, StringValue: "<built-in function print>", ReprValue: "<built-in function print>", }, "hash": &PyFunction{ Callable: PyHash, StringValue: "<built-in function hash>", ReprValue: "<built-in function hash>", }, }
View Source
var PyEq = NewPyString("==")
View Source
var PyFalse = &PyBool{Value: false}
View Source
var PyNone = &NoneType{}
View Source
var PyTrue = &PyBool{Value: true}
Functions ¶
func GetPyHashSeed ¶
func PyHashImplementation ¶
func PyPrintImplementation ¶
func PyPrintImplementation( args PyObject, sep PyObject, end PyObject, file PyObject, flush *PyBool, )
https://github.com/python/cpython/blob/main/Python/bltinmodule.c#L1987 (builtin_print_impl)
Types ¶
type PyBinaryAdd ¶
type PyBinarySubstract ¶
type PyDict ¶
type PyDict struct {
Value map[int64][]*PyDictKeyValue
}
type PyDictKeyValue ¶
type PyFunction ¶
type PyFunction struct { Callable func(PyObject, PyObject) PyObject StringValue string ReprValue string }
func (*PyFunction) Equal ¶
func (self *PyFunction) Equal(b PyObject) *PyBool
func (*PyFunction) Hash ¶
func (self *PyFunction) Hash() (int64, error)
func (*PyFunction) Repr ¶
func (self *PyFunction) Repr() string
func (*PyFunction) String ¶
func (self *PyFunction) String() string
type PyInt ¶
func (*PyInt) BinarySubstract ¶
type PyIterable ¶
type PyIterable interface { PyObject Iter() PyIterator // __iter__ }
type PyIterator ¶
type PyIterator interface { PyIterable Next() (PyObject, error) // __next__ }
type PyList ¶
type PyList struct {
Value []PyObject
}
func (*PyList) Extend ¶
func (self *PyList) Extend(value PyIterable)
func (*PyList) Iter ¶
func (self *PyList) Iter() PyIterator
type PyListIterator ¶
type PyListIterator struct {
// contains filtered or unexported fields
}
func (*PyListIterator) Equal ¶
func (self *PyListIterator) Equal(other PyObject) *PyBool
func (*PyListIterator) Hash ¶
func (self *PyListIterator) Hash() (int64, error)
func (*PyListIterator) Iter ¶
func (self *PyListIterator) Iter() PyIterator
func (*PyListIterator) Next ¶
func (self *PyListIterator) Next() (PyObject, error)
func (*PyListIterator) Repr ¶
func (self *PyListIterator) Repr() string
func (*PyListIterator) String ¶
func (self *PyListIterator) String() string
type PyObject ¶
type PyStringIterator ¶
type PyStringIterator struct {
// contains filtered or unexported fields
}
func (*PyStringIterator) Equal ¶
func (self *PyStringIterator) Equal(other PyObject) *PyBool
func (*PyStringIterator) Hash ¶
func (self *PyStringIterator) Hash() (int64, error)
func (*PyStringIterator) Iter ¶
func (self *PyStringIterator) Iter() PyIterator
func (*PyStringIterator) Next ¶
func (self *PyStringIterator) Next() (PyObject, error)
func (*PyStringIterator) Repr ¶
func (self *PyStringIterator) Repr() string
func (*PyStringIterator) String ¶
func (self *PyStringIterator) String() string
type PyTuple ¶
type PyTuple struct {
Value []PyObject
}
func (*PyTuple) Iter ¶
func (self *PyTuple) Iter() PyIterator
type PyTupleIterator ¶
type PyTupleIterator struct {
// contains filtered or unexported fields
}
func (*PyTupleIterator) Equal ¶
func (self *PyTupleIterator) Equal(other PyObject) *PyBool
func (*PyTupleIterator) Hash ¶
func (self *PyTupleIterator) Hash() (int64, error)
func (*PyTupleIterator) Iter ¶
func (self *PyTupleIterator) Iter() PyIterator
func (*PyTupleIterator) Next ¶
func (self *PyTupleIterator) Next() (PyObject, error)
func (*PyTupleIterator) Repr ¶
func (self *PyTupleIterator) Repr() string
func (*PyTupleIterator) String ¶
func (self *PyTupleIterator) String() string
Click to show internal directories.
Click to hide internal directories.