@@ -47,7 +47,7 @@ type context struct {
4747
4848// NewContext creates a new gpython interpreter instance context.
4949//
50- // See type Context interface for info.
50+ // See interface py. Context defined in py/run.go
5151func NewContext (opts py.ContextOpts ) py.Context {
5252 ctx := & context {
5353 opts : opts ,
@@ -109,6 +109,7 @@ func (ctx *context) ModuleInit(impl *py.ModuleImpl) (*py.Module, error) {
109109 return module , nil
110110}
111111
112+ // See interface py.Context defined in py/run.go
112113func (ctx * context ) ResolveAndCompile (pathname string , opts py.CompileOpts ) (py.CompileOut , error ) {
113114 err := ctx .pushBusy ()
114115 defer ctx .popBusy ()
@@ -202,7 +203,7 @@ func (ctx *context) popBusy() {
202203 ctx .running .Done ()
203204}
204205
205- // Close -- see type py.Context
206+ // See interface py.Context defined in py/run.go
206207func (ctx * context ) Close () error {
207208 ctx .closeOnce .Do (func () {
208209 ctx .closing = true
@@ -216,7 +217,7 @@ func (ctx *context) Close() error {
216217 return nil
217218}
218219
219- // Done -- see type py.Context
220+ // See interface py.Context defined in py/run.go
220221func (ctx * context ) Done () <- chan struct {} {
221222 return ctx .done
222223}
@@ -274,6 +275,7 @@ func resolveRunPath(runPath string, opts py.CompileOpts, pathObjs []py.Object, t
274275 return err
275276}
276277
278+ // See interface py.Context defined in py/run.go
277279func (ctx * context ) RunCode (code * py.Code , globals , locals py.StringDict , closure py.Tuple ) (py.Object , error ) {
278280 err := ctx .pushBusy ()
279281 defer ctx .popBusy ()
@@ -284,10 +286,12 @@ func (ctx *context) RunCode(code *py.Code, globals, locals py.StringDict, closur
284286 return vm .EvalCode (ctx , code , globals , locals , nil , nil , nil , nil , closure )
285287}
286288
289+ // See interface py.Context defined in py/run.go
287290func (ctx * context ) GetModule (moduleName string ) (* py.Module , error ) {
288291 return ctx .store .GetModule (moduleName )
289292}
290293
294+ // See interface py.Context defined in py/run.go
291295func (ctx * context ) Store () * py.ModuleStore {
292296 return ctx .store
293297}
0 commit comments