Skip to content

Commit 634823c

Browse files
author
Drew O'Meara
committed
consistent arg order of NewFunction
1 parent 71a5604 commit 634823c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

py/function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (f *Function) GetDict() StringDict {
5656
// attribute. qualname should be a unicode object or ""; if "", the
5757
// __qualname__ attribute is set to the same value as its __name__
5858
// attribute.
59-
func NewFunction(code *Code, ctx Ctx, globals StringDict, qualname string) *Function {
59+
func NewFunction(ctx Ctx, code *Code, globals StringDict, qualname string) *Function {
6060
var doc Object
6161
if len(code.Consts) >= 1 {
6262
doc = code.Consts[0]

vm/eval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ func _make_function(vm *Vm, argc int32, opcode OpCode) {
14371437
num_annotations := (argc >> 16) & 0x7fff
14381438
qualname := vm.POP()
14391439
code := vm.POP()
1440-
function := py.NewFunction(code.(*py.Code), vm.ctx, vm.frame.Globals, string(qualname.(py.String)))
1440+
function := py.NewFunction(vm.ctx, code.(*py.Code), vm.frame.Globals, string(qualname.(py.String)))
14411441

14421442
if opcode == MAKE_CLOSURE {
14431443
function.Closure = vm.POP().(py.Tuple)

0 commit comments

Comments
 (0)