Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

The better part of valor is discretion. -- William Shakespeare, "Henry IV"


comp / comp.lang.python / Re: pdb: How to use the 'break' parameter?

SubjectAuthor
o Re: pdb: How to use the 'break' parameter?Peter J. Holzer

1
Subject: Re: pdb: How to use the 'break' parameter?
From: Peter J. Holzer
Newsgroups: comp.lang.python
Date: Thu, 22 Aug 2024 06:08 UTC
References: 1 2 3
Attachments: signature.asc (application/pgp-signature)
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: hjp-python@hjp.at (Peter J. Holzer)
Newsgroups: comp.lang.python
Subject: Re: pdb: How to use the 'break' parameter?
Date: Thu, 22 Aug 2024 08:08:46 +0200
Lines: 60
Message-ID: <mailman.63.1724307318.2890.python-list@python.org>
References: <1213218119.10733806.1724291075830.ref@mail.yahoo.com>
<1213218119.10733806.1724291075830@mail.yahoo.com>
<20240822060846.hojhyg25dql25ziu@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
protocol="application/pgp-signature"; boundary="e5iev4uv6jfpewj6"
X-Trace: news.uni-berlin.de JZ2DhoQWnqBZNxtNeHzgqg8TrDIqdysWWtTskfQNiSZw==
Cancel-Lock: sha1:NaAWzAy80Cg6nC+lC5areXbJm3w= sha256:jftrmEk5/f1RRbIvupslp2pcEktTbC4Rkx1yx9nGnaM=
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'content-
type:multipart/signed': 0.05; 'blank': 0.09; 'content-
type:application/pgp-signature': 0.09; 'filename:fname piece:asc':
0.09; 'filename:fname piece:signature': 0.09;
'filename:fname:signature.asc': 0.09; 'syntax': 0.15; '"creative':
0.16; "'d',": 0.16; "(i'm": 0.16; '__/': 0.16; 'challenge!"':
0.16; 'doc': 0.16; 'from:addr:hjp-python': 0.16;
'from:addr:hjp.at': 0.16; 'from:name:peter j. holzer': 0.16;
'hjp@hjp.at': 0.16; 'holzer': 0.16; 'reality.': 0.16; 'spec':
0.16; 'stross,': 0.16; 'subject:parameter': 0.16; 'syntaxerror:':
0.16; 'url-ip:212.17.106/24': 0.16; 'url-ip:212.17/16': 0.16;
'url:hjp': 0.16; '|_|_)': 0.16; 'wrote:': 0.16; 'probably': 0.17;
"can't": 0.17; 'to:addr:python-list': 0.20; 'subject:How': 0.23;
'function': 0.27; 'sense': 0.28; 'do.': 0.32; 'python-list': 0.32;
'white': 0.32; 'header:In-Reply-To:1': 0.34; 'invalid': 0.35;
'cell': 0.36; 'means': 0.38; 'break': 0.39; 'exact': 0.40;
'something': 0.40; 'skip:o 10': 0.61; 'received:212': 0.62;
'your': 0.64; 'received:userid': 0.66; '8bit%:7': 0.67; 'url-
ip:212/8': 0.69; 'charset:iso-8859-1': 0.73; 'supposed': 0.76;
'"or",': 0.84; 'entered': 0.84; 'received:at': 0.84; 'skip:p 60':
0.93
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <1213218119.10733806.1724291075830@mail.yahoo.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <20240822060846.hojhyg25dql25ziu@hjp.at>
X-Mailman-Original-References: <1213218119.10733806.1724291075830.ref@mail.yahoo.com>
<1213218119.10733806.1724291075830@mail.yahoo.com>
View all headers

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!"

Attachments: signature.asc (application/pgp-signature)
1

rocksolid light 0.9.8
clearnet tor