Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #8: static buildup


comp / comp.lang.python.announce / [Python-announce] peek: like print, but easy

SubjectAuthor
o [Python-announce] peek: like print, but easyRuud van der Ham

1
Subject: [Python-announce] peek: like print, but easy
From: Ruud van der Ham
Newsgroups: comp.lang.python.announce
Date: Sun, 1 Dec 2024 17:59 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rt.van.der.ham@gmail.com (Ruud van der Ham)
Newsgroups: comp.lang.python.announce
Subject: [Python-announce] peek: like print, but easy
Date: Sun, 1 Dec 2024 18:59:30 +0100
Lines: 12
Approved: python-announce-list@python.org
Message-ID: <CAB-X1xGCQADN636FGmKP9HQsK4raEy6_Qae+_=jEqHhEaWeUqA@mail.gmail.com>
Reply-To: python-list@python.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
X-Trace: news.uni-berlin.de 5YMAbj+Mzw+PbTyJ3ejPIgykHXZ96lGlKJlFlAd0sKcQ==
Cancel-Lock: sha1:Gfg+9FAGOVjsejhYD+OjWNiUHC4= sha256:24Qfvt5URK+YOK7A2cvtY7RceoygEmBWwk7u6t4h8u4=
Delivered-To: python-announce-list@x.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=CTxMNSHV;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.068
X-Spam-Evidence: '*H*': 0.89; '*S*': 0.03; 'debug': 0.07;
'dependencies': 0.09; 'docs,': 0.09; 'subject:but': 0.09; 'to:addr
:python-announce-list': 0.09; 'import': 0.15; 'announce': 0.15;
'interface,': 0.16; 'like\xc2\xa0': 0.16; 'pythonic': 0.16;
'goes': 0.28; 'message-id:@mail.gmail.com': 0.31;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.34; 'those':
0.36; '...': 0.37; 'adding': 0.39; 'something': 0.40; 'true':
0.63; 'skip:b 10': 0.63; 'further': 0.69; 'skip:w 20': 0.69;
'powerful': 0.84; '==>': 0.84; 'url-ip:185.104/16': 0.84;
'==&gt;': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1733075981; x=1733680781; darn=python.org;
h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
:date:message-id:reply-to;
bh=KWHLz+8EF0klOycnCV1CuAeu/TBbBFlIEw44oTq2NOg=;
b=CTxMNSHVKtNdD8aMo6eOi8Qac12aNHZ0zVQIwGhFY7HYLfzDlyzR3nxT1xO/GeIuHL
9X6MLYRtmfm0W/+VsiiISEpc4Ij60FO5BeHMSO8K+jskguzwD3l3+vivQmQjX6gfAw6T
ZvBapbR05CaZH/Ha8HMaPNy26rhI/yA6CI2EdAmk7JLmYhRiLTh4L3+99RJjX3aWBCqU
nO8bYPqMJvaEj+b4mx6m+qDGi7DumvsSjWQGMenrUtMTdomlNFHzMBYO7OeBVblvFWIM
1vyrSSvDvamDxNehCltGQWGbzl8JLMIQQq88ZNrS0g6skEaEmkvHfhtEFAHfBNIooUlr
0ucQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1733075981; x=1733680781;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=KWHLz+8EF0klOycnCV1CuAeu/TBbBFlIEw44oTq2NOg=;
b=BIurzRDoV6KZvK5TraL8jy2SP+wBkxXVLUx1yeibC+Z7vT0HAouXh+pKvsv7OnfAL6
BDjPUt5Ynr54vWl0kJl/yZf9WyPBVkYfia9QIrWV6jC3YP4dD6UY+iiiT56hvAD14Lkt
XQaYbHqKd+6BZAE4WgVJPZ+VponYT6S0fJ3V4qBNjkcAs3fxcrXSdHnmN5j9aIfJkg6C
d5ow2B8QYaScz1d9/2LwO2WRVcMqoD96aB+p/hiy1I5hHSnGt+WhHYiyKYFy4jKM0ElT
pOjTWqTe46YgQaXspn/cT/m2JZEN71/NrcCXQROTr1JwUwtd4yeS3t4b6ZtiPiNzcuPn
2HaA==
X-Gm-Message-State: AOJu0Yzvf/NLcuO7hzyZyMIzjKf6WERte4F90qwfuY6y0nrFynw63YSM
ILhBQBMp3/yghWtUIfAFJCVE9HPWiX5YHlOEKnSf02fy6ZRV7iXcVjJm/k8elAcU3YyDWcAnJiN
jP2u+7TvQd2XbiBIIS1kBEuXzilG1lA==
X-Gm-Gg: ASbGncsN3pWTUMli1PawgfJvPpV0x2ABlTSf/txdPpYKDvoaBtnoK8aLNciJeLoPXEJ
qc3KI6spDKa0qMIEZaDO11JvgxsTnEg==
X-Google-Smtp-Source: AGHT+IFCugefDHEZ2MQqZ6V0ZaRL69ZY11HBuFgX3Iza609VQ8EEWLmeSAbBJdT9yyqN1AagvXoHR/66IyDg68PfvTY=
X-Received: by 2002:a17:90b:3c82:b0:2ea:adaa:1a5a with SMTP id
98e67ed59e1d1-2ee097bd797mr22017291a91.26.1733075981113; Sun, 01 Dec 2024
09:59:41 -0800 (PST)
X-MailFrom: rt.van.der.ham@gmail.com
X-Mailman-Rule-Hits: emergency
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-python-announce-list.python.org-0; header-match-python-announce-list.python.org-1; header-match-python-announce-list.python.org-2; header-match-python-announce-list.python.org-3; header-match-python-announce-list.python.org-4
Message-ID-Hash: XK4XSJL2Y56DU4SA2KPM4S74FGLGW5IU
X-Message-ID-Hash: XK4XSJL2Y56DU4SA2KPM4S74FGLGW5IU
X-Mailman-Approved-At: Sun, 01 Dec 2024 13:55:20 -0500
X-Content-Filtered-By: Mailman/MimeDel 3.3.11b1
X-Mailman-Version: 3.3.11b1
Precedence: list
List-Id: Announcement-only list for the Python programming language <python-announce-list.python.org>
Archived-At: <https://mail.python.org/archives/list/python-announce-list@python.org/message/XK4XSJL2Y56DU4SA2KPM4S74FGLGW5IU/>
List-Archive: <https://mail.python.org/archives/list/python-announce-list@python.org/>
List-Help: <mailto:python-announce-list-request@python.org?subject=help>
List-Owner: <mailto:python-announce-list-owner@python.org>
List-Post: <mailto:python-announce-list@python.org>
List-Subscribe: <mailto:python-announce-list-join@python.org>
List-Unsubscribe: <mailto:python-announce-list-leave@python.org>
View all headers

This is to announce the availability of a new package: peek.
To include powerful debug print statement, all you have to do is:
import peek
my_string = "hallo"
my_dict = dict(a=1, b=2)
peek(my_string, my_dict)
And you get
my_string='hallo', my_dict={'a': 1, 'b': 2}
Or, if you add
peek.show_line_number = True
you get something like
#5 ==> my_string='hallo', my_dict={'a': 1, 'b': 2}
For those who know icecream: peek goes much further in adding benchmarking,
a Pythonic interface, import time customization, better docs, etc.
And ... no dependencies whatsoever!
For more information, see www.salabim.org/peek

1

rocksolid light 0.9.8
clearnet tor