- Python was fun in the past with quick script writing and pleasant syntax.
- Now it causes rage and sadness with non-trivial code due to type and exception issues.
- Python uses duck typing, making it hard to determine variable types without running code.
- Variables can have multiple types based on program flow, leading to runtime errors.
- MyPy is a step in the right direction but has limitations and a bad syntax.
- In a ~3500 LoC Python library/program, there are 25
# type: ignore
annotations. - Python's exception management is poor with no way to declare raised exceptions.
- Tools to validate caught exceptions are lacking.
- Examples like
re.compile
,tarfile.open
, andPIL
show various possible exceptions. - Wrapping stdlib calls in
try: … except Exception:
is bad. - Dealing with untrusted file formats requires meaningful exceptions.
- Python is old but still has issues like raising strange exceptions.
- Don't let friends write production code in Python with weird file formats as things will explode.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。