Comments (5)
The gpython print
is fairly minimal at the moment and certainly needs improving.
I think this particular bug is caused by this line doing the argument parsing wrong (not sure exactly why).
Line 185 in 4b347aa
from gpython.
@ncw
There is a temporary way to modify the builtin_print.
But I don't think it's the right way.
func builtin_print(self py.Object, args py.Tuple, kwargs py.StringDict) (py.Object, error) {
var (
sepObj py.Object = py.String(" ")
endObj py.Object = py.String("\n")
file py.Object = py.MustGetModule("sys").Globals["stdout"]
flush py.Object
)
kwlist := []string{"sep", "end", "file", "flush"}
for _, kw := range kwlist {
switch _, ok := kwargs[kw]; ok {
case true:
continue
default:
if kw == "sep" {
kwargs[kw] = sepObj
} else if kw == "end" {
kwargs[kw] = endObj
} else if kw == "file" {
kwargs[kw] = file
} else {
kwargs[kw] = flush
}
}
}
err := py.ParseTupleAndKeywords(nil, kwargs, "|ssOO:print", kwlist, &sepObj, &endObj, &file, &flush)
...
from gpython.
py.ParseTupleAndKeywords
should be doing that for us...
The bug must be in this bit of code I think... No time to investigate further right now - over to you to have a look!
Lines 444 to 453 in 8c361a8
from gpython.
suggest @sbinet close -- fixed w/ #151
from gpython.
fixed w/ #151.
from gpython.
Related Issues (20)
- Decimal.from_float takes bad arguments crashing gpython HOT 1
- Double underlines("_") for nonlocal variable names crash gpython HOT 1
- Large hex_string of pickle.load() crashes gpython HOT 3
- Reassignment of 'getattr' leads to gpython crashing HOT 2
- Annotating types with decorators crashes gpython HOT 1
- '__import__' takes incorrect arguments crashing gpython HOT 1
- Comparing uncomparable types in 'is' crashes gpython HOT 1
- Transforming unsupported types into a set leads to crashing HOT 1
- Defining Nested set crashes gpython HOT 1
- transforming generators into list trigger crashing HOT 1
- Taking large arguments in functions crashes gpython HOT 1
- Compiling long operations crashes gpython HOT 3
- How to get `globals()` inside Go bounded method?
- Set attributes on python objects from Go code HOT 3
- Do you need type conversion of struct? HOT 6
- Can you guys put a pure python library as a built-in library, So the battery will be a built-in feature? HOT 1
- function not found with error AttributeError: "'module' has no attribute 'pre_save'" HOT 2
- Error when i try to get the `__doc__` from a type like `str`
- Support f-string
- `str` is missing `join`, `upper` and `lower` attributes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpython.