Commit e68726e8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8e7e9dcb
......@@ -32,11 +32,13 @@ type IPyPersistent interface {
//PyClass() pickle.Class // python class of this object
// PyState() interface{} // object state. python passes this to pyclass.__new__().__setstate__()
/*
// IPyPersistent must be stateful for persistency to work
// XXX try to move out of IPyPersistent? Rationale: we do not want e.g. PySetState to
// be available to user who holds IPyPersistent interface: it is confusing to have
// both PActivate and PySetState at the same time.
PyStateful
*/
}
// PyPersistent is common base implementation for in-RAM representation of ZODB Python objects.
......@@ -65,8 +67,10 @@ type PyStateful interface {
//
// this should be always safe because we always create pyObjects via
// newGhost which passes IPyPersistent as instance to IPersistent. XXX no longer true
func (pyobj *PyPersistent) pyinstance() IPyPersistent {
return pyobj.instance.(IPyPersistent)
//func (pyobj *PyPersistent) pyinstance() IPyPersistent {
func (pyobj *PyPersistent) pyinstance() interface {IPyPersistent; Ghostable; PyStateful} {
//return pyobj.instance.(IPyPersistent)
return pyobj.instance.(interface {IPyPersistent; Ghostable; PyStateful})
}
func (pyobj *PyPersistent) SetState(state *mem.Buf) error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment