[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- nosy: -Jeffrey.Kintscher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo
Ramesh Sahoo added the comment: Thank Steven for correcting and guiding me. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> not a bug status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Tue, Aug 11, 2020 at 07:16:20AM +, Ramesh Sahoo wrote: > for i in stack: > print("inside if Popped =",stack.pop(stack.index(i))) You are mutating the list while you iterate over it. This is prone to cause trouble. Here's is a much smaller and

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo
Ramesh Sahoo added the comment: Additional note: The following program completes all 5 iterations. #!/usr/bin/python3 stack = [s for s in range(5)] c = 0 for i in stack: c += 1 print(f"{'='*10} loop {c} {'='*10}") if i == 0 or i == 1 or i == 2: print(f"{i}\n") else: print(f

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo
Ramesh Sahoo added the comment: Hi all, Thanks for your valuable response. I would like to inform you that I found this issue while playing with the following code. This is reproducible with Python 3.8. Please find the following details and let me know if I am doing something wrong. [U

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-11 Thread Ramesh Sahoo
Change by Ramesh Sahoo : -- resolution: works for me -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Eric V. Smith
Eric V. Smith added the comment: I agree, Steven. This doesn't seem to be a problem with Python. It's more likely a problem with the user's shell, or some other environment integration problem. If it can be duplicated in 3.8 or later, we can investigate further. --

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Python 3.6 has reached security-fix only stage: https://www.python.org/dev/peps/pep-0494/#schedule-last-bugfix-release so even if this is a bug, it won't be fixed in 3.6. I cannot reproduce this in 3.7, and Eric cannot reproduce in 3.6.9, so I'm closing th

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Eric V. Smith
Eric V. Smith added the comment: Also, how are you running this? From the interactive shell (like I show in my previous message), or some other way? -- ___ Python tracker ___

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Eric V. Smith
Eric V. Smith added the comment: Here's what I see: Python 3.6.9 (default, Jul 21 2019, 14:33:59) [GCC 7.4.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> stack = ['(', '(', '[', ']', ')'] >>> for i in stack: ... print(i) ... ( ( [ ] ) That looks co

[issue41518] incorrect printing behavior with parenthesis symbols

2020-08-10 Thread Ramesh Sahoo
New submission from Ramesh Sahoo : With for loop, I am able to print all elements in the list 'a' a = ['a','a','b','b','c'] for i in a: print(i) O/P: a a b b c but with the following loop, python only prints 3 uniq elements instead of 5. stack = ['(', '(', '[', ']', ')'] for i in stac