用 Claude Code 做了个 Claude Code 的成本计算器
2025 7 27 10:28 PM 0 条评论 21 次查看

をつあおにまで GFW!
2025 7 27 10:28 PM 0 条评论 21 次查看
2025 7 20 03:00 AM 0 条评论 60 次查看
2025 7 11 06:56 PM 0 条评论 537 次查看
帮我开发一个macOS应用:
1. 平时它在后台静默运行。
2. 当用户截图或在任意应用(如浏览器)中复制图片时,它自动检测图片中的文本内容。
3. 如果检测到有文本内容,就弹出一个小窗口,并提供一键复制功能,过几秒钟自动关闭窗口。
4. 用户可以打开菜单栏,查看历史的文本列表。(无需持久化,保存最近5条。)
先不要写代码,如果需要用vscode创建必要的环境,指导我怎么做。直到我完成环境配置后,才开始生成代码
我已经创建好了,请检查下项目结构,开始写代码。如果需要操作,请通知我
2025 4 11 05:16 PM 0 条评论 87 次查看
ctx.QueryArgs().Peek("foo")
。紧随其后的是 atreugo,写法也是类似:ctx.UserValue("foo").(string)
。2025 1 26 05:32 PM 0 条评论 154 次查看
2024 12 26 11:13 PM 0 条评论 169 次查看
boto3
)来进行调用,没有异步实现。2024 9 30 05:19 PM 0 条评论 165 次查看
2024 8 9 12:26 AM 0 条评论 512 次查看
2024 7 14 11:11 PM 0 条评论 520 次查看
2024 5 29 07:45 PM 0 条评论 381 次查看
ProxiesTypes
:URLTypes = Union["URL", str]
ProxyTypes = Union[URLTypes, "Proxy"]
ProxiesTypes = Union[ProxyTypes, Dict[URLTypes, Union[None, ProxyTypes]]]
可以看出,dict[str, str]
应该是符合它的参数签名的,然而我传入一个 dict[str, str]
参数后,Pylance 却会报错,这让我大为不解。from typing import Mapping
a: dict[int, int] = {}
b: dict[int, int | str] = a # error:
# Expression of type "dict[int, int]" is incompatible with declared type "dict[int, int | str]"
# "dict[int, int]" is incompatible with "dict[int, int | str]"
# Type parameter "_VT@dict" is invariant, but "int" is not the same as "int | str"
# Consider switching from "dict" to "Mapping" which is covariant in the value type
c: Mapping[int, int | str] = a
d: Mapping[int | str, int] = a # error:
# Expression of type "dict[int, int]" is incompatible with declared type "Mapping[int | str, int]"
# "dict[int, int]" is incompatible with "Mapping[int | str, int]"
# Type parameter "_KT@Mapping" is invariant, but "int" is not the same as "int | str"
是不是很奇怪,为啥 dict[int, int]
和 dict[int, int | str]
或 Mapping[int | str, int]
都不兼容,而与 Mapping[int, int | str]
兼容?