ChatCrawlersearch across public Telegram Open the app
P

Python 中文交流群

snapshot for June 2025
June 2025 ×
16 June 2025
S
当然Python没有内置Result类型,但你可以理解成带一些错误处理方法的Union[T, E]
S
除非你看文档给自己当人肉 type checker
17 June 2025
诶…总之 python 既然没有对返回异常的特别支持,用抛出异常我觉得完全 ok 呢
Z
业务上也没有任何理由说抛出异常不行,返回异常就可以
21 June 2025
Python 没必要通过返回值来区分是否有异常吧, 有 Exception 体系
try catch 起来, catch 里写异常处理逻辑
又不像 go 和 rust, 推荐使用返回值 err 和 Result 来区分
P
使用语言推荐的模式使用酒吧了
X
不过我没统计过
A
你看go和rust有这玩意吗?
22 June 2025
A
go/rust/c++不用异常是因为性能太差,python没这个问题
叫 panic,然后可以 unwind/recover
那不就是传统的异常吗
Open in Telegram Каталог площадок Искать в ChatCrawler

A snapshot of an open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog