---
title: "資深 Python 工程師提交的程式碼如何被審查 - Keith Yang"
tags: PyConTW2023, 2023-organize, 2023-共筆
---
# 資深 Python 工程師提交的程式碼如何被審查 - Keith Yang
{%hackmd H6-2BguNT8iE7ZUrnoG1Tg %}
<iframe src=https://app.sli.do/event/m9KrcKWd3AHhwZNGhxYbsk height=450 width=100%></iframe>
> Collaborative writing start from below
> 從這裡開始共筆
1. Six Key Points of Senior Python Code Review
2. Environment and tool
## Six Key Points of Senior Python Code Review
### Code Review
- Quality Assureance
- Knowledge Sharing
- Finding and Fixing Bugs Early
提出修改之前,先閱讀過 Python Developer's Guide
https://devguide.python.org/
### 1st Key Point : Comment
Code Readability
- 寫出清楚的程式碼 > 寫註解
### 2nd Key Point : Concise Code
### 3rd Key Point : Naming
Description for human
Command line Tool : ripgrep
Code & Infra Readablilty
Mark code and module easy to understand > If it's tricky, write comments and doc ...
```python
python -m this
```
### 4th Key Point : Unused Code
Linting tool: ruff, flaske8, pre-commit
### 5th Key Point : Senior Knew Comment Python Errors
1. default for func arguments
2. modifying a list while iterating over it
3. lambda in for loop.
### 6th Key Point : PEP8
- Read the doc?
- Tools
- Black, isort
- flake8, ruff
- pre-comment
### Extra Key Point : Type Hint
### Documentation
- Why to and why not
- Commit Message
- Pull-Request
Below is the part that speaker updated the talk/tutorial after speech
講者於演講後有更新或勘誤投影片的部份
- [投影片連結](https://www.canva.com/design/DAFoVEZETAU/fa33DHLu_PlYHuTWYOAoww/view)
![16_9](https://hackmd.io/_uploads/ByJYJCowa.jpg)