这句话的翻译是?(PEP585)
資深大佬 : imn1 3
手册中:
class typing.Iterable(Generic[T_co])
A generic version of collections.abc.Iterable.
Deprecated since version 3.9: collections.abc.Iterable now supports []. See PEP 585.
class typing.Iterable(Generic[T_co])
A generic version of collections.abc.Iterable.
Deprecated since version 3.9: collections.abc.Iterable now supports []. See PEP 585.
后面这句指的是 3.9 弃用 collections.abc.Iterable,还是弃用 typing.Iterable ?
它用逗号我理解是弃用 typing.Iterable,用冒号我就糊涂了
PEP585 中有这句:
This PEP proposes to enable support for the generics syntax in all standard collections currently available in the typing module.
PEP585 太长,英语不佳
其实一直对多个模块( types, collections, typing 等)重复的类型定义不解,不知道下面这样理解对不对?
多个模块对于类型的定义,依据 PEP585 弃用,转到 typing 模块去归一定义
还是要反向理解,而 typing 模块只着重于处理方法,定义由其他模块完成
希望是用 typing 归一,判断一个类型要 import 好几个模块真是累
大佬有話說 (10)