原文: Awesome Python Weekly - Issue 523
- 260607 Zoom.Quiet用时 17 分钟 完成格式转抄.
- 260607 Zoom.Quiet用时 42 分钟 完成快译
快讯
Popular News and Articles
![]()
(是也乎:
历史反复证明, DSL 编译环境最佳的就是 Python
bash$ python lispytest.py
python lispytest.py
(quote (testing 1 (2.0) -3.14e159)) => (testing 1 (2.0) -3.14e+159)
(+ 2 2) => 4
(+ (* 2 100) (* 1 10)) => 210
(if (> 6 5) (+ 1 1) (+ 2 2)) => 2
(if (< 6 5) (+ 1 1) (+ 2 2)) => 4
(define x 3) => None
x => 3
(+ x x) => 6
(begin (define x 1) (set! x (+ x 1)) (+ x 1)) => 3
((lambda (x) (+ x x)) 5) => 10
(define twice (lambda (x) (* 2 x))) => None
(twice 5) => 10
(define compose (lambda (f g) (lambda (x) (f (g x))))) => None
((compose list twice) 5) => (10)
(define repeat (lambda (f) (compose f f))) => None
((repeat twice) 5) => 20
((repeat (repeat twice)) 5) => 80
(define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1)))))) => None
(fact 3) => 6
(fact 50) => 30414093201713378043612608166064768844377641568960512000000000000
(define abs (lambda (n) ((if (> n 0) + -) 0 n))) => None
(list (abs -3) (abs 0) (abs 3)) => (3 0 3)
(define combine (lambda (f)
(lambda (x y)
(if (null? x) (quote ())
(f (list (car x) (car y))
((combine f) (cdr x) (cdr y))))))) => None
(define zip (combine cons)) => None
(zip (list 1 2 3 4) (list 5 6 7 8)) => ((1 5) (2 6) (3 7) (4 8))
(define riff-shuffle (lambda (deck) (begin
(define take (lambda (n seq) (if (<= n 0) (quote ()) (cons (car seq) (take (- n 1) (cdr seq))))))
(define drop (lambda (n seq) (if (<= n 0) seq (drop (- n 1) (cdr seq)))))
(define mid (lambda (seq) (/ (length seq) 2)))
((combine append) (take (mid deck) deck) (drop (mid deck) deck))))) => None
(riff-shuffle (list 1 2 3 4 5 6 7 8)) => (1 5 2 6 3 7 4 8)
((repeat riff-shuffle) (list 1 2 3 4 5 6 7 8)) => (1 3 5 7 2 4 6 8)
(riff-shuffle (riff-shuffle (riff-shuffle (list 1 2 3 4 5 6 7 8)))) => (1 2 3 4 5 6 7 8)
********************************************* lis.py: 0 out of 29 tests fail.
(quote (testing 1 (2.0) -3.14e159)) => (testing 1 (2.0) -3.14e+159)
(+ 2 2) => 4
(+ (* 2 100) (* 1 10)) => 210
(if (> 6 5) (+ 1 1) (+ 2 2)) => 2
(if (< 6 5) (+ 1 1) (+ 2 2)) => 4
(define x 3) => None
x => 3
(+ x x) => 6
(begin (define x 1) (set! x (+ x 1)) (+ x 1)) => 3
((lambda (x) (+ x x)) 5) => 10
(define twice (lambda (x) (* 2 x))) => None
(twice 5) => 10
(define compose (lambda (f g) (lambda (x) (f (g x))))) => None
((compose list twice) 5) => (10)
(define repeat (lambda (f) (compose f f))) => None
((repeat twice) 5) => 20
((repeat (repeat twice)) 5) => 80
(define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1)))))) => None
(fact 3) => 6
(fact 50) => 30414093201713378043612608166064768844377641568960512000000000000
(define abs (lambda (n) ((if (> n 0) + -) 0 n))) => None
(list (abs -3) (abs 0) (abs 3)) => (3 0 3)
(define combine (lambda (f)
(lambda (x y)
(if (null? x) (quote ())
(f (list (car x) (car y))
((combine f) (cdr x) (cdr y))))))) => None
(define zip (combine cons)) => None
(zip (list 1 2 3 4) (list 5 6 7 8)) => ((1 5) (2 6) (3 7) (4 8))
(define riff-shuffle (lambda (deck) (begin
(define take (lambda (n seq) (if (<= n 0) (quote ()) (cons (car seq) (take (- n 1) (cdr seq))))))
(define drop (lambda (n seq) (if (<= n 0) seq (drop (- n 1) (cdr seq)))))
(define mid (lambda (seq) (/ (length seq) 2)))
((combine append) (take (mid deck) deck) (drop (mid deck) deck))))) => None
(riff-shuffle (list 1 2 3 4 5 6 7 8)) => (1 5 2 6 3 7 4 8)
((repeat riff-shuffle) (list 1 2 3 4 5 6 7 8)) => (1 3 5 7 2 4 6 8)
(riff-shuffle (riff-shuffle (riff-shuffle (list 1 2 3 4 5 6 7 8)))) => (1 2 3 4 5 6 7 8)
() =raises=> SyntaxError (): wrong length
(set! x) =raises=> SyntaxError (set! x): wrong length
(define 3 4) =raises=> SyntaxError (define 3 4): can define only a symbol
(quote 1 2) =raises=> SyntaxError (quote 1 2): wrong length
(if 1 2 3 4) =raises=> SyntaxError (if 1 2 3 4): wrong length
(lambda 3 3) =raises=> SyntaxError (lambda 3 3): illegal lambda argument list
(lambda (x)) =raises=> SyntaxError (lambda (x)): wrong length
(if (= 1 2) (define-macro a 'a)
(define-macro a 'b)) =raises=> SyntaxError (define-macro a (quote a)): define-macro only allowed at top level
(define (twice x) (* 2 x)) => None
(twice 2) => 4
(twice 2 2) =raises=> TypeError expected (x), given (2 2),
(define lyst (lambda items items)) => None
(lyst 1 2 3 (+ 2 2)) => (1 2 3 4)
(if 1 2) => 2
(if (= 3 4) 2) => None
(define ((account bal) amt) (set! bal (+ bal amt)) bal) => None
(define a1 (account 100)) => None
(a1 0) => 100
(a1 10) => 110
(a1 10) => 120
(define (newton guess function derivative epsilon)
(define guess2 (- guess (/ (function guess) (derivative guess))))
(if (< (abs (- guess guess2)) epsilon) guess2
(newton guess2 function derivative epsilon))) => None
(define (square-root a)
(newton 1 (lambda (x) (- (* x x) a)) (lambda (x) (* 2 x)) 1e-8)) => None
(> (square-root 200.) 14.14213) => #t
(< (square-root 200.) 14.14215) => #t
(= (square-root 200.) (sqrt 200.)) => #t
(define (sum-squares-range start end)
(define (sumsq-acc start end acc)
(if (> start end) acc (sumsq-acc (+ start 1) end (+ (* start start) acc))))
(sumsq-acc start end 0)) => None
(sum-squares-range 1 3000) => 9004500500
(call/cc (lambda (throw) (+ 5 (* 10 (throw 1))))) ;; throw => 1
(call/cc (lambda (throw) (+ 5 (* 10 1)))) ;; do not throw => 15
(call/cc (lambda (throw)
(+ 5 (* 10 (call/cc (lambda (escape) (* 100 (escape 3)))))))) ; 1 level => 35
(call/cc (lambda (throw)
(+ 5 (* 10 (call/cc (lambda (escape) (* 100 (throw 3)))))))) ; 2 levels => 3
(call/cc (lambda (throw)
(+ 5 (* 10 (call/cc (lambda (escape) (* 100 1))))))) ; 0 levels => 1005
(* 1i 1i) => (-1+0i)
(sqrt -1) => 1i
(let ((a 1) (b 2)) (+ a b)) => 3
(let ((a 1) (b 2 3)) (+ a b)) =raises=> SyntaxError (let ((a 1) (b 2 3)) (+ a b)): illegal binding list
(and 1 2 3) => 3
(and (> 2 1) 2 3) => 3
(and) => #t
(and (> 2 1) (> 2 3)) => #f
(define-macro unless (lambda args `(if (not ,(car args)) (begin ,@(cdr args))))) ; test ` => None
(unless (= 2 (+ 1 1)) (display 2) 3 4) => None
2
(unless (= 4 (+ 1 1)) (display 2) (display "\n") 3 4) => 4
(quote x) => x
(quote (1 2 three)) => (1 2 three)
'x => x
'(one 2 3) => (one 2 3)
(define L (list 1 2 3)) => None
`(testing ,@L testing) => (testing 1 2 3 testing)
`(testing ,L testing) => (testing (1 2 3) testing)
`,@L =raises=> SyntaxError (unquote-splicing L): can't splice here
'(1 ;test comments '
;skip this line
2 ; more ; comments ; ) )
3) ; final comment => (1 2 3)
********************************************* lispy.py: 0 out of 81 tests fail.
)
![]()
![]()
(是也乎:
常见幽灵访问现象...
)
- Show HN: 一款地形改造游戏,你编写的 Python 代码就是游戏玩法。
- store.steampowered.com
![]()
(是也乎:
这和当年 JAVA 社区开始的 坦克大战
很相似...
后来 erlang 社区也有类似的..
)
-
- jump.academy
-
通过 Pyodide 和 Service Worker 在浏览器中运行 Python ASGI 应用
- simonwillison.net
![]()
- 如何在不损失类型安全性的前提下打破 Python 中的循环导入
- www.orcaset.com
![]()
- Python 入门指南
- wiki.python.org
![]()
- Rust 是为那些想要受罚的人准备的:现在他更信任它而不是 Python
- belderbos.dev
好物/妙品/
Interesting Projects, Tools and Libraries, Projects & Code
更多 : 通过社交媒体提及次数查找最受欢迎的 Python 库
- whichllm
- » AI
- » CLI
找到真正能在你硬件上运行且性能最佳的本地 LLM。排名依据真实、近期测试结果,而非参数数量。只需一条命令,即可立即运行。
(是也乎:
这...才是真正靠谱的工具...
)
- ainativelang
- » Compiler
- » Domain-specific language
AINL 旨在将 AI 从“智能对话”转变为“结构化工作者”。它专为构建需要多步骤、状态和内存管理、工具使用、可重复执行、验证和控制,以及降低对冗长提示循环依赖的 AI 工作流的团队而设计。AINL 是一个紧凑的、符合图规范的、原生于 AI 的编程系统(详见:README)。
(是也乎:
Python 实现...
)
- auto-browser
- » Docker
- » self-hosted
让你的 AI 代理使用真正的浏览器——并让人类参与其中。开源的 MCP 原生浏览器代理。
(是也乎:
对于开源项目, 有一个基本感觉: 凡是 logo 没认真设计的, 一般都不长久...
)
- bernstein 琥珀色
- » Cursor
- » developer-tools
适用于 CLI 编码代理(Claude Code、Codex、Gemini CLI 等 40 多个代理)的审计级多代理编排。支持 HMAC 链式审计日志、代理签名卡、基于工件的血缘关系以及物理隔离部署。您的合规团队一定会认可这款编排器。https://bernstein.run
(是也乎:
叕一个 Hermess 类方案... 应该很快关键可行行为, 将被 大模型, 直接吸收...
)
- ppf-contact-solver
- » Physics
- » Simulation
用于涉及 👚 壳、🪵 固体和 🪢 杆的基于物理的模拟的接触求解器。
DAMA
❤️ Happy Pythonic ;-(
大妈私人无责任播报)
- 大妈的多重宇宙 - YouTube
- @Chaos42DAMA
- 恢复各种嗯哼...
NN 6228
_~~*`~_
\/ / # ♡ \ (/
'_ ⎕ _'
\ '--.--' <
...act by ferris-actor v0.2.4 (built on 23.0303.201916)
Happy Pythonic
PPS
不觉中蟒周刊快译已经到了第10+4个年头 之前也有小伙伴加入过
pythonisa周刊的翻译, 但是, 没坚持下来, 也就自己这么默默坚持下来了...
问为什么:
[皱眉]每周新闻资讯 怎么能错过
看看有什么新东西
当有新的发现时:
what f**k 还能这样玩? 还有这东西?
每周开彩蛋[吃瓜]
无法同意更多...
很多社区贡献看起来辛苦,
其实受益最多的,
就是主动承担者也.
好文笔,感叹号年度配额: 0/3
投稿/反馈邮箱:
askdama@googlegroups.com
(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)
ZoomQuiet/大妈
就是四处 是也乎,( ̄▽ ̄) 的那个大妈:
全职嗯哼: 大妈的多重宇宙 - https://www.youtube.com/@Chaos42DAMA
私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
as 创始组织者:
CPyUG (mailling-list: python-cn@googlegroups.com)
PyChina (订阅号: PyChinaOrg)
本地社区:
FMHub (大小湾终身幼儿园)
AIGC珠海
(是也乎:
之前快译的周刊: https://discu.eu/weekl01python/ 从25年8月开始经常 523 错误, 无法访问, 所以, 切换回古老的 PyCoder’s Weekly | A Weekly Python Email Newsletter, 除了编号不同,每周关注到的新内容其实并无过大不同; 但是, 又因为 pycoders.com 的周刊所有链接都指向自己的内部链接, 导致发布平台认为我的快译是引流,已经封号; 只好, 继续切换快译对象: pythonweekly 官方推荐的周刊 然而, 2025年尾 这个私人维护的周刊连续跳票两周; 不得以继续切换为 Awesome Python Weekly:
)
Comments