Python Forum
Weird behaviour using if statement in python 3.10.8
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird behaviour using if statement in python 3.10.8
#16
(Jan-15-2023, 06:31 PM)deanhystad Wrote: The best way to demonstrate the wrong behavior is to produce an example that allows others to reproduce what you are seeing. So far the only way I can reproduce what is shown in your screenshot is to edit the code condition (change from True to False) after stepping to the print statement.

If you cannot reproduce the behavior in a small example program, it usually means the problem is not what you think it is. I see this is line 92. Maybe there is something odd going on in lines 1-90. I cannot imagine what that might be, but there is nothing wrong with the two lines you posted.

How are you running the debugger? Just using the Run menu -> Start Debugging? What is your debugging configuration?
Exactly, I run the debugger as you mentioned. I will check the debug configuration and maybe there is something wrong there. I will post if I have fixed it. BTW what are the most important configuration in VS Code for the python debugger?

EDIT:
As I can observe the problem is related to VS Code, because when I execute the code in the terminal (Ubuntu 20.04.LTS), the code runs properly. I will check further the settings and come back later.
Reply


Messages In This Thread
RE: Weird behaviour using if statement in python 3.10.8 - by mikepy - Jan-15-2023, 06:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  logger behaviour setdetnet 1 935 Apr-15-2023, 05:20 AM
Last Post: Gribouillis
  can someone explain this __del__ behaviour? rjdegraff42 1 775 Apr-12-2023, 03:25 PM
Last Post: deanhystad
  Asyncio weird behaviour vugz 2 1,326 Apr-09-2023, 01:48 AM
Last Post: vugz
  Generator behaviour bla123bla 2 1,153 Jul-26-2022, 07:30 PM
Last Post: bla123bla
  Inconsistent behaviour in output - web scraping Steve 6 2,646 Sep-20-2021, 01:54 AM
Last Post: Larz60+
  IWhat is the cause to get XPath in weird format using Python? MDRI 7 3,802 May-27-2021, 02:01 AM
Last Post: MDRI
  Adding to the dictionary inside the for-loop - weird behaviour InputOutput007 5 2,813 Jan-21-2021, 02:21 PM
Last Post: InputOutput007
  Behaviour of 2D array SimonB 6 2,920 Jan-21-2021, 01:29 PM
Last Post: SimonB
  strange behaviour- plotting nathan_Blanc_Haifa 0 1,526 Dec-27-2020, 01:37 PM
Last Post: nathan_Blanc_Haifa
  OOP behaviour problem JohnB 3 2,466 Aug-18-2020, 07:51 PM
Last Post: JohnB

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020