Uh oh!
There was an error while loading. Please reload this page.
Fixed "print function's "end" option error in CPython" - #92
Conversation
The following code writes different string to the stream than in CPython: print(1,2,3, end="||\n") The following code writes different string to the stream than in CPython: print(1,2,3, end="||\n") I fixed that bug by modifying the code
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## master #92 +/- ##
==========================================
+ Coverage 69.09% 69.10% +0.01%
==========================================
Files 60 60 Lines 10674 10678 +4 ==========================================
+ Hits 7375 7379 +4
Misses 2781 2781 Partials 518 518 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
corona10
left a comment
There was a problem hiding this comment.
@Sungmin-Joo Please add a unit test which you updated.
add "end" test in cpython
Sungmin-Joo
commented
Sep 27, 2019
@corona10 |
corona10
commented
Sep 27, 2019
@Sungmin-Joo AS-IS>>>print(1,2,3, end="||\n")
1||2||3||TO-BE>>>print(1,2,3, end="||\n")
123|| |
| return nil, err | ||
| } | ||
| if kwargs["sep"] != nil { |
There was a problem hiding this comment.
what about:
switchsep, ok:=kwargs["sep"]; ok {
casetrue:
sepObj=sepdefault:
sepObj=py.String(" ")
}| print("hello","gpython", end="123\n") | ||
| except TypeError as e: | ||
| ok = True | ||
| assert ok, "TypeError not raised" |
There was a problem hiding this comment.
| assertok, "TypeError not raised" | |
| assertok, "TypeError not raised when 'sep' is not in the kwargs dict" |
that said, I am not sure I understand this test.
do we really want this line to raise an exception? why?
| assert ok, "TypeError not raised" | ||
| try: | ||
| print("hello","gpython", end="123\n") |
There was a problem hiding this comment.
| print("hello","gpython", end="123\n") | |
| print("hello","gpython", end="123\n") |
corona10
commented
Sep 28, 2019
@Sungmin-Joo@sbinet err:=py.ParseTupleAndKeywords(nil, kwargs, "|ssOO:print", kwlist, &sepObj, &endObj, &file, &flush)I am now closing this PR |
The following code writes different string to the stream than in CPython:
I fixed that bug by modifying the code
resolved: #93