You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I noticed that the type hints in spikingjelly do not support Python3.6 in fact.
This commit 880f589 added type hints like list[nn.Module], which are fully supported from Python3.9 according to PEP-585.
In Python3.7 to 3.8, you should use them after from __future__ import annotations.
And in 3.6, there should be typing.List[nn.Module].
According to Python, version 3.6 and 3.7 is unsupported and end-of-life, and 3.8 is supported until October 2024.
There should be nobody using new versionspikingjelly with old version Python.
So new versionspikingjelly can stop supporting Python before 3.7 or 3.8.
Issue type
Description
I noticed that the type hints in
spikingjelly
do not support Python3.6 in fact.This commit 880f589 added type hints like
list[nn.Module]
, which are fully supported from Python3.9 according to PEP-585.In Python3.7 to 3.8, you should use them after
from __future__ import annotations
.And in 3.6, there should be
typing.List[nn.Module]
.我注意到,目前
spikingjelly
的类型标注实际上已经不再支持Python3.6在880f589这个commit中,代码就使用了形如
list[nn.Module]
的类型标注根据PEP-585,这种用法在Python3.7往后版本需要
from __future__ import annotations
才能使用,从3.9开始才被完全支持,事实上在3.6应当使用typing.List[nn.Module]
Solution
Aliases like
typing.List
were deprecated since Python3.9.So type hints in code should vary from versions.
typing
from __future__ import annotations
, then the same as 3.9同样根据PEP-585,
typing.List
、typing.Tuple
等自3.9版本开始被弃用 ,而移除不会早于Python3.9结束生命周期,也就是25年10月因此代码中应该根据Python版本选择使用的类型注解
typing
模块的别名from __future__ import annotations
,然后与3.9相同Discussion
According to Python, version 3.6 and 3.7 is unsupported and end-of-life, and 3.8 is supported until October 2024.
There should be nobody using new version
spikingjelly
with old version Python.So new version
spikingjelly
can stop supporting Python before 3.7 or 3.8.根据Python官方,3.6以及3.7版本已经结束生命周期,3.8也将在24年10月结束生命周期。
理论上应该没有新项目在使用新版
spikingjelly
的同时使用Python3.7及之前的版本,3.8也类似因此新版
spikingjelly
可以放弃对旧版本Python(3.7或3.8之前的版本)的支持The text was updated successfully, but these errors were encountered: