Forwarded from dnaugsuz
草,Python 里管这 (:=) 叫 walrud operator... 复辟 C 的节奏啊
optional chain 不好吗,非得来函数式/OOP 那套,既然只是 corner case
def let(f, x): return f(x) if x!=None else x
ref = let('refs/heads/'.__add__, conf.get('branch')) or 'HEAD'optional chain 不好吗,非得来函数式/OOP 那套,既然只是 corner case
Forwarded from dnaugsuz
正常人都是用 d[k] 然后 except KeyError 啊…… 的确静态检查不友好
Forwarded from dnaugsuz
Forwarded from mivik::channels::tech
但很遗憾被 std(或许应该叫 stl 来着) 吊着锤了
测试代码:https://paste.ubuntu.com/p/YbhnC5qXqV/
测试代码:https://paste.ubuntu.com/p/YbhnC5qXqV/
Forwarded from 「VoP」維尼之聲 - Voice of Pooh🔊
谷歌今年又在直播圣诞老人,点此访问圣诞老人追踪网站:santatracker.google.com
在本信息发表时,圣诞老人已经离开中国
本次圣诞老人仅拜访中国大陆的香港市、长沙市、上海市、重庆市、西安市、北京市、呼和浩特市,其他地区的读者请吃掉为圣诞老人准备的牛奶🥛和曲奇🍪,并上床不等了睡大觉。
#圣诞节 #轻松一刻
在本信息发表时,圣诞老人已经离开中国
本次圣诞老人仅拜访中国大陆的香港
#圣诞节 #轻松一刻
#Python 草,竟然支持“多行”lambda (其实只是多行表达式……
from oslash import put_line, get_line
啊不对,没有 def …… 直接 main=(x:IO)
from oslash import put_line, get_line
def main(): return get_line() |(lambda s: put_line(s)) 啊不对,没有 def …… 直接 main=(x:IO)
Forwarded from dnaugsuz
类型签名上检查器它无法重载 Optional[T] 的 None 和 T 情况啊…… 对它来说只是限制用户可不可以传 None 而已
而且 PY 好像也不太重视 _Noreturn 的 (nonlocal)jump 执行情况
而且 PY 好像也不太重视 _Noreturn 的 (nonlocal)jump 执行情况
Forwarded from Hung-I Wang
dbrattli/OSlash: Functors, Applicatives, And Monads in Python
https://github.com/dbrattli/OSlash
https://github.com/dbrattli/OSlash
GitHub
GitHub - dbrattli/OSlash: Functors, Applicatives, And Monads in Python
Functors, Applicatives, And Monads in Python. Contribute to dbrattli/OSlash development by creating an account on GitHub.
Forwarded from Hung-I Wang
那有没有 Allow writing class types as {a: int, b: int} (