skip to Main Content

I am working on Python and I am passing a parameter named id to my fucntion and i want to pause the execution for debugging purpose (check the value of response) if and only if the value of id is equal to ‘586982’.

enter image description here

But the execution is getting paused for all values of id irrespectively of == and =.

I tried the following cases:

  1. id = 586982
  2. id == 586982
  3. id = "586982"
  4. id == "586982"

I tried to find a solution but i am not getting any.

Note: I changed variable name since id is a built in keyword in python but its still not working

2

Answers


  1. If the variable id is an int, the condition should be written: id == 586982 . If it is a string : id == "586982" .

    However, id is normally a python function used to get the identifier of an object: id(your_object). I am guessing that you have overridden it, which is not a good practice. There is likely somewhere in your code something like: id = some_text_or_some_int .

    Login or Signup to reply.
  2. I made a simple reproduction and didn’t encounter this problem.

    After you entered the expression, you have to press Enter to save the breakpoint.

    For example:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search