-
Notifications
You must be signed in to change notification settings - Fork 95
Implement set operation #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
These operations can be implemented on here based on below code. https://github.com/go-python/gpython/blob/master/py/set.go#L65 func (s *Set) M__and__(other Object) (Object, error) {
// TODO: Implement
return ret, nil
} |
I want to implement this issue |
@DoDaek |
I wrote the set primitives for gotemplate here: https://github.com/ncw/gotemplate/blob/master/set/set.go These were based off the python primitives so should work with very little modification other than changing the types. Feel free to use those here :-) |
Hi Team, I found another operation to implement. # python 3.7.4
>>> a = set([1,2,3])
>>> for ai in a:
... print(ai)
...
1
2
3 # gpython
>>> a = set([1,2,3])
panic: interface conversion: py.Object is *py.List, not py.Tuple
goroutine 1 [running]:
github.com/go-python/gpython/py.SetNew(0xc0000ed290, 0xc00013ead0, 0x1, 0x3, 0x0, 0x14bc828, 0x0, 0x0, 0x42152e0)
/Users/sanggihong/go/src/github.com/go-python/gpython/py/set.go:63 +0x20d
github.com/go-python/gpython/py.(*Type).M__call__(0xc0000ed290, 0xc00013ead0, 0x1, 0x3, 0x0, 0xc000115301, 0x104491e, 0xc0000f0ec0, 0xc00009db70)
/Users/sanggihong/go/src/github.com/go-python/gpython/py/type.go:380 +0x82
github.com/go-python/gpython/py.Call(0x12f9f40, 0xc0000ed290, 0xc00013ead0, 0x1, 0x3, 0x0, 0x1279040, 0x1, 0xc0002a1e40, 0xc000115448)
/Users/sanggihong/go/src/github.com/go-python/gpython/py/internal.go:169 +0x299
github.com/go-python/gpython/vm.callInternal(0x12f9f40, 0xc0000ed290, 0xc00013ead0, 0x1, 0x3, 0x0, 0xc0000cc370, 0xc0000f4e40, 0x0, 0x0, ...)
/Users/sanggihong/go/src/github.com/go-python/gpython/vm/eval.go:1606 +0xcf
github.com/go-python/gpython/vm.(*Vm).Call(0xc00010c930, 0x1, 0x0, 0x0, 0x0, 0x0, 0xc0000f0ee0, 0xc00013eac0)
/Users/sanggihong/go/src/github.com/go-python/gpython/vm/eval.go:1689 +0xf44
github.com/go-python/gpython/vm.do_CALL_FUNCTION(0xc00010c930, 0xc000000001, 0x0, 0x0)
/Users/sanggihong/go/src/github.com/go-python/gpython/vm/eval.go:1428 +0x40
github.com/go-python/gpython/vm.RunFrame(0xc0000cc370, 0x0, 0xc000115a20, 0xc00013eac0, 0x0)
/Users/sanggihong/go/src/github.com/go-python/gpython/vm/eval.go:1785 +0x338
github.com/go-python/gpython/vm.EvalCodeEx(0xc0000e4200, 0xc000140000, 0xc000140000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/sanggihong/go/src/github.com/go-python/gpython/vm/eval.go:2162 +0x1014
github.com/go-python/gpython/vm.Run(...)
/Users/sanggihong/go/src/github.com/go-python/gpython/vm/eval.go:2182
github.com/go-python/gpython/repl.(*REPL).Run(0xc000146000, 0xc0002ad580, 0x10)
/Users/sanggihong/go/src/github.com/go-python/gpython/repl/repl.go:99 +0x397
github.com/go-python/gpython/repl/cli.RunREPL()
/Users/sanggihong/go/src/github.com/go-python/gpython/repl/cli/cli.go:147 +0x295
main.main()
/Users/sanggihong/go/src/github.com/go-python/gpython/main.go:73 +0xf51 Would it be better to make a new issue? |
Looks like this bug is can be closed; the appropriate pull-requests linked here were merged :) |
These operations should be implemented
The text was updated successfully, but these errors were encountered: