Код: Выделить всё
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:38:29) [Clang 13.0.1 ] \
on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Iterable
>>> isinstance(list[str], Iterable)
False
>>> list(list[str])
Traceback (most recent call last):
File "", line 1, in
TypeError: 'types.GenericAlias' object is not iterable
Код: Выделить всё
Python 3.11.0 | packaged by conda-forge | (main, Jan 15 2023, 05:44:48) [Clang 14.0.6 ] \
on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Iterable
>>> isinstance(list[str], Iterable)
True
>>> list(list[str])
[*list[str]]
Что здесь происходит? Я знаю, что набор текста на Python постоянно меняется и быстро развивается, но я действительно не знаю, как это интерпретировать.
Подробнее здесь: https://stackoverflow.com/questions/756 ... n-iterable