第二篇杂录 侧重最佳实践.
最近 (2021/10/28) 发现官方文档有 Programming FAQ — Python 3.10.0 documentation, 很有用.
Misc
- python - What do * (single star) and / (slash) do as independent parameters? - Stack Overflow
- performance - Python: Remove all duplicates from a large list of lists efficiently and elegantly - Stack Overflow 用 pandas 对大列表快速保序去重
一些语法糖
2023/1/10
(1,) + (2, 3)
# (1, 2, 3)
a = {1: 1}
b = {2: 2}
{**a, **b}
# {1: 1, 2: 2}
nonlocal
2022/7/5
忘了看哪个源码的时候读到的
Python の nonlocal と global の違い - Qiita
functools
lru_cache 以及 singledispatch
