• pdb: How to use the 'break' parameter?

    From Kevin M. Wilson@21:1/5 to All on Thu Aug 22 01:44:35 2024
    break (Old_MacDonald:23 | name[indx] == 'd', indx = 4), based on the doc spec in python.org (https://docs.python.org/3/library/pdb.html#debugger-commands)
    Cell In[1], line 20
    break (Old_MacDonald:23 | name[indx] == 'd', indx = 4)
    ^
    SyntaxError: invalid syntax
    I got one blank white screen when I entered the exact first line of the python.org-->b(reak) [([filename:]lineno | function) [, condition]]

    I'd be obliged for an assist... KMW ***************************************************
    "When you pass through the waters, I will be with you: and when you pass through the rivers, they will not sweep over you. When you walk through the fire, you will not be burned: the flames will not set you ablaze."     
    Isaiah 43:2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter J. Holzer@21:1/5 to Kevin M. Wilson via Python-list on Thu Aug 22 08:08:46 2024
    On 2024-08-22 01:44:35 +0000, Kevin M. Wilson via Python-list wrote:
    break (Old_MacDonald:23 | name[indx] == 'd', indx = 4), based on the doc spec in python.orgá(https://docs.python.org/3/library/pdb.html#debugger-commands)
    Cell In[1], line 20
    break (Old_MacDonald:23 | name[indx] == 'd', indx = 4)
    ^
    SyntaxError: invalid syntax
    I got one blank white screen when I entered the exact first line of the python.org-->b(reak)á[([filename:]linenoá|áfunction)á[,ácondition]]

    You misunderstood the notation. The | means "or", it is not something
    you have to type literally.

    So the syntax is:
    either a line number (maybe in a different file) or a function name
    optionally followed by a condition after a comma

    So in your case probably something like:

    break Old_MacDonald:23, name[indx] == 'd'

    (I'm not sure what "indx = 4" was supposed to do. You can't assign
    inside of a condition.)

    hp

    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmbG1ekACgkQ8g5IURL+ KF0aEA//d0QN59PTIs5JbHPyLXnpEEJx1bvtJhjkNSbv/feLGWJGqH2c4TILjJxA jCL9Wda52d8ZBIdsW96Mtiq9IEZfOe3iBeMREfos6SJGBbvPdADm8zqb1yAGBApT spxAYkRHkOdb3hXHTu0NcdaDs57iO8D1fBzpXUdgLj71KK/flbS+nWB9ZFyI+QfP qg6R7rUYmTTifWra8FM/c6k9Bfd2ojk2X5EWoOKehSNniEBerJlw4S1w5yalMotz G5iqCpekfTLQl/EYYvK/ngejAebJcJnNmHetnEKLuMoyavepOl3EImugV7GGHAwg 0SCcDL0zPoQPAjfLE65JS495wmOnJ/kU4cnWK+lPcL0HeFg5jXBYseg2sTBr3GFe 4Op5cp3n6W/al75xc2yI5rsX40S3AcKggmamyuCkgGdVUXmnCwRlIEsMpSFNk7nI 3GKXs5ZGodveKcemhNax7cxPQ7aiDa2XdujH0qmFz5q4cg6dfnetS4RVI53WV4LN rHkmlM2TUjVaMRDFYMOymeKRtfraZWV9hxXrXuWMjPaG2okvd3aI0KzTcUtugzDA K5k20rq5dvhzZtfJcgVvQhjD/AQzrMd3cCKIysOQ3ZbPDvc8z0J49zeQNH9LykoB FltQpCLH1/oT4+H/bzrX8CuLidYXrBVAGIFhDvb