对 Cursor 的一些观察和思考
2025 1 26 05:32 PM 0 条评论 24 次查看
をつあおにまで GFW!
2025 1 26 05:32 PM 0 条评论 24 次查看
2024 12 26 11:13 PM 0 条评论 55 次查看
boto3
)来进行调用,没有异步实现。2024 12 23 05:41 PM 0 条评论 20 次查看
QNetworkRequest
来创建网络连接的,没有写任何代理相关的代码。由于我是用 SOCKS5/HTTP 代理翻墙,并没有采用 VPN 这种全局代理的方式,因此只能另找方法让它使用代理。2024 9 30 05:19 PM 0 条评论 104 次查看
2024 9 4 12:30 AM 3 条评论 557 次查看
分类:无 标签:无
2024 8 9 12:26 AM 0 条评论 435 次查看
2024 7 14 11:11 PM 0 条评论 428 次查看
2024 5 29 07:45 PM 0 条评论 278 次查看
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]
兼容?2024 5 16 12:17 AM 2 条评论 538 次查看
2024 5 14 12:12 AM 0 条评论 294 次查看