reference.go 308 B

1234567891011121314151617181920212223
  1. package python
  2. /*
  3. #define PY_SSIZE_T_CLEAN
  4. #include <Python.h>
  5. */
  6. import "C"
  7. //
  8. // Reference
  9. //
  10. type Reference struct {
  11. Object *C.PyObject
  12. }
  13. func NewReference(pyObject *C.PyObject) *Reference {
  14. return &Reference{pyObject}
  15. }
  16. func (self *Reference) Type() *Type {
  17. return NewType(self.Object.ob_type)
  18. }