hardbyte / hardbyte/python-can

Python 3.7, 3.8, 3.9, or 3.10 as minimal version

未关闭
#1,220 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
Python
星标
1.6k
派生
697
PR 合并指标
30 天内没有已合并 PR

描述

Hi,
This is continued discussion of Python3 at the end of #528 which is about Python2.
I summary pros and cons dicussed in #528 and important features in official What's new in Python 3.X

Python 3.10
___________
Pros:

- Structural Pattern Matching
- Allow writing union types as X | Y
- Parenthesized context managers

Cons:

- Latest Python version, most Linux distros now support now
- No PyPy3.10 release info available

Python 3.9
__________
Pros:
- built-in CAN_RAW_JOIN_FILTERS support
- built-in CAN_J1939 support
- Dictionary Merge & Update Operators
- Supported or built-in in recent released Linux distros
- PEP 585, type hinting generics in standard collections (update)

Cons:
- PyPy3.9 not released, but should be soon, according it's release history.

Python 3.8
__________
Pros:
- Assignment expressions
- f-strings support = for self-documenting expressions and debugging
- Positional-only parameters
- Supported or built-in in most Linux distros
- PyPy3.8 released

Cons:
- Not supported or or built-in in old Linux distros

Python 3.7
__________
Pros:
- built-in CAN_ISOTP support
- The new breakpoint() function.
- Forced UTF-8 Runtime Mode
- Python data model improvements
- New Time Functions With Nanosecond Resolution
- Best compatibility compared with 3.8~3.10

Cons:
- Some popular packages have dropped support 3.7, such as NumPy, IPython. more packages should also drop 3.7 support in furture.
- No CAN_RAW_JOIN_FILTERS & CAN_J1939 intruduced in 3.9 (best features in CAN bus in personally)
- No assignment & f-string self-documenting expressions intruduced in 3.8 (best features in language in personally)
- All new features in 3.7 are included in 3.8~3.10.

__________
Also, asyncio module is almost improved in each main version of Python.

So, in personlly, I prefer Python 3.9 or 3.8 as minimal supported version.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。