gpython
gpython copied to clipboard
gpython is a python interpreter written in go "batteries not included"
Thanks to tengo and @ncw, we can compare the gpython with other interpreted which are implemented in Go. https://github.com/d5/tengo#benchmark fib(35) benchmark is slower than I expected, we can optimize this...
## python ``` >>> a = 'alpha' >>> b = 'bravo' >>> d = 'delta' >>> origin = '{} {} charlie {}' >>> new = origin.format(a, b, d) >>> print(new)...
We define a function and recursive call the function in test.py crashing gpython. This case cannot crash CPython and it reports a RecursionError. test.py: ``` def f(): f() f() ```...
Consider the following code ```python3 $ ./gpython Python 3.4.0 (none, unknown) [Gpython dev] - os/arch: linux/amd64 - go version: go1.16.6 >>> exit() Traceback (most recent call last): File "", line...
For a long time I have been interested in gPython. GoLang’s CSP just seems so easy to use compared to Python’s Asyincio ( coroutines). But Python has so many great...
https://github.com/nlpodyssey/gopickle
Attribute errors occured using list. **Python (expected)** ``` >>> a.pop() 4 >>>a [1,2,3] >>>a.pop(1) 2 >>>a [1,3] ``` **gpython (Actual)** ``` >>> a = [1,2,3,4] >>> a.pop() Traceback (most...
We have to calculate the hash according to the type of Object and return a value. There is currently `M__hash__` but it is not implemented in any Object. ```go type...
https://github.com/go-python/gpython/blob/33327c5231b03c84972bec57262694aebbaa1e84/py/dict.go#L68 Change the dict to receive a hashable object as a key, not just a string. I will change it so that the object can be looked up through the...
But accepted in gpython it should be raised Syntax error. ## cpython ``` python >>> def a(x=3, b, c): ... pass ... File "", line 1 SyntaxError: non-default argument follows...