Skip to content
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

Bug: sep is ignored while printing when two adjacent values are either strings or integers #2677

Open
kmr-srbh opened this issue Apr 30, 2024 · 0 comments · May be fixed by #2820
Open

Bug: sep is ignored while printing when two adjacent values are either strings or integers #2677

kmr-srbh opened this issue Apr 30, 2024 · 0 comments · May be fixed by #2820

Comments

@kmr-srbh
Copy link
Contributor

The value of sep is ignored while printing when two adjacent values are strings.

print("a", "b", "c", "d", "e", sep="-")
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
abcde

The same is the case for integers.

print(1, 2, 3, 4, 5, sep=" is less than ")
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
12345

Please note that this is not an issue with the keyword argument itself. When two adjacent objects are necessarily not strings or integers, the value is used.

print(1, 2, 3, 4, 5, "a", "b", "c", [1, 2, 3, 4], sep="->")
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
12345abc->[1, 2, 3, 4]

The presence of a list leads to the usage of the separator.

@xaerru xaerru linked a pull request Jan 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant