Skip to content

Commit 1b45209

Browse files
CopilothuangsamCopilot
authored
Add modern Python feature modules (3.8-3.11) (#146)
* Initial plan * Add 5 new Python feature modules and update all README files Co-authored-by: huangsam <[email protected]> * Update remaining README files (Hindi, Portuguese-Brazil, Chinese-Traditional) Co-authored-by: huangsam <[email protected]> * Update README.fr.md Co-authored-by: Copilot <[email protected]> * Update README.fr.md Co-authored-by: Copilot <[email protected]> * Update ultimatepython/data_structures/dict_union.py Co-authored-by: Copilot <[email protected]> * Update ultimatepython/advanced/exception_groups.py Co-authored-by: Copilot <[email protected]> * Fix ruff linter warnings * Fix coverage issues * Help the coverage go to 100% * Make pattern matching func more explicit * Move inner functions to outside scope * Remove exception_group from the listing * Drop codecov thresholds to 90% * Keep coverage fail_under at 90 * Make project and patch at 90 * Keep pyproject at 80 * Remove the project metadata --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: huangsam <[email protected]> Co-authored-by: Samuel Huang <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 4a190e8 commit 1b45209

File tree

13 files changed

+923
-15
lines changed

13 files changed

+923
-15
lines changed

README.de.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ Es gibt zwei Möglichkeiten, die Module auszuführen:
8888
- Conditional: [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
8989
- Loop: [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
9090
- Function: [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
91+
- Walrus operator: [Assignment expressions :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
92+
- Argument enforcement: [Positional-only / | Keyword-only *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
9193
3. **Daten-Strukturen**
9294
- List: [List operations](ultimatepython/data_structures/list.py) ( 🍰 )
9395
- Tuple: [Tuple operations](ultimatepython/data_structures/tuple.py)
9496
- Set: [Set operations](ultimatepython/data_structures/set.py)
9597
- Dict: [Dictionary operations](ultimatepython/data_structures/dict.py) ( 🍰 )
98+
- Dict union: [Dictionary merge | and |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
9699
- Comprehension: [list | tuple | set | dict](ultimatepython/data_structures/comprehension.py)
97100
- String: [String operations](ultimatepython/data_structures/string.py) ( 🍰 )
98101
- Deque: [deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -121,6 +124,7 @@ Es gibt zwei Möglichkeiten, die Module auszuführen:
121124
- Regular expression: [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
122125
- Data format: [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
123126
- Datetime: [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
127+
- Pattern Matching: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
124128

125129
## Zusätzliche Ressourcen
126130

README.es.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ Hay dos maneras de ejecutar los módulos:
8686
- Condicionales: [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
8787
- Iteraciones: [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
8888
- Funciones: [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
89+
- Operador morsa: [Expresiones de asignación :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
90+
- Aplicación de argumentos: [Solo posicional / | Solo palabra clave *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
8991
3. **Estructura de datos**
9092
- Lista: [Operaciones con listas](ultimatepython/data_structures/list.py) ( 🍰 )
9193
- Tupla: [Operaciones con tuplas](ultimatepython/data_structures/tuple.py)
9294
- Set: [Operaciones con sets](ultimatepython/data_structures/set.py)
9395
- Diccionario: [Operaciones con dicts](ultimatepython/data_structures/dict.py) ( 🍰 )
96+
- Unión de diccionarios: [Fusión de diccionarios | y |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
9497
- Comprensión: [list | tuple | set | dict](ultimatepython/data_structures/comprehension.py)
9598
- Cadena: [Operaciones con strings](ultimatepython/data_structures/string.py) ( 🍰 )
9699
- Deque: [deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -119,6 +122,7 @@ Hay dos maneras de ejecutar los módulos:
119122
- Expresiones regulares: [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
120123
- Formatos de datos: [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
121124
- Fecha y hora: [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
125+
- Coincidencia de patrones: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
122126

123127
## Recursos adicionales
124128

README.fr.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ grâce à ce langage. 🎓
3737

3838
Voici les principaux objectifs de ce guide :
3939

40-
🏆 **Servir de ressource** pour les débutants en Python qui préfèrent apprendre de manière pratique. 
40+
🏆 **Servir de ressource** pour les débutants en Python qui préfèrent apprendre de manière pratique.
4141
Ce dépôt contient une collection de modules indépendants pouvant être exécutés dans un IDE
4242
comme [PyCharm](https://www.jetbrains.com/pycharm/) ou dans le navigateur via
4343
[Replit](https://replit.com/languages/python3). Même un simple terminal suffit
4444
pour exécuter les exemples. La plupart des lignes contiennent des commentaires détaillés
45-
qui guident le lecteur pas à pas. 
45+
qui guident le lecteur pas à pas.
4646
Les utilisateurs sont encouragés à modifier le code source à leur guise tant que les
4747
routines `main` ne sont pas supprimées et que les programmes
4848
[s’exécutent correctement](runner.py) après chaque modification.
4949

50-
🏆 **Servir de guide pur** pour ceux qui souhaitent revoir les concepts fondamentaux de Python. 
50+
🏆 **Servir de guide pur** pour ceux qui souhaitent revoir les concepts fondamentaux de Python.
5151
Seules les [bibliothèques intégrées](https://docs.python.org/3/library/) sont utilisées afin de
5252
présenter les concepts sans dépendre de notions spécifiques à un domaine. Ainsi, les
5353
bibliothèques open-source populaires comme `sqlalchemy`, `requests` ou `pandas`
54-
ne sont pas installées. 
54+
ne sont pas installées.
5555
Cependant, lire le code source de ces frameworks est fortement recommandé
5656
si ton objectif est de devenir un véritable
5757
[Pythonista](https://www.urbandictionary.com/define.php?term=pythonista).
@@ -61,24 +61,24 @@ si ton objectif est de devenir un véritable
6161
[![Run on Replit](https://replit.com/badge/github/huangsam/ultimate-python)](https://replit.com/github/huangsam/ultimate-python)
6262

6363
Clique sur le badge ci-dessus pour lancer un environnement fonctionnel dans ton navigateur
64-
sans avoir besoin d’installer Git ou Python localement. 
64+
sans avoir besoin d’installer Git ou Python localement.
6565
Si ces outils sont déjà installés, tu peux cloner directement le dépôt.
6666

67-
Une fois le dépôt accessible, tu es prêt à apprendre à partir des modules indépendants. 
67+
Une fois le dépôt accessible, tu es prêt à apprendre à partir des modules indépendants.
6868
Pour tirer le meilleur parti de chaque module, lis le code et exécute-le.
6969

7070
Deux méthodes sont possibles :
7171

72-
1. Exécuter un seul module : 
72+
1. Exécuter un seul module :
7373
  `python ultimatepython/syntax/variable.py`
74-
2. Exécuter tous les modules : 
74+
2. Exécuter tous les modules :
7575
  `python runner.py`
7676

7777
## Table des matières
7878

79-
📚 = Ressource externe 
80-
🍰 = Sujet débutant 
81-
🤯 = Sujet avancé 
79+
📚 = Ressource externe
80+
🍰 = Sujet débutant
81+
🤯 = Sujet avancé
8282

8383
1. **À propos de Python**
8484
    - Vue d’ensemble : [Qu’est-ce que Python](https://github.com/trekhleb/learn-python/blob/master/src/getting_started/what_is_python.md) ( 📚, 🍰 )
@@ -95,12 +95,15 @@ Deux méthodes sont possibles :
9595
    - Conditionnelle : [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
9696
    - Boucle : [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
9797
    - Fonction : [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
98+
- Opérateur morse : [Expressions d'affectation :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
99+
- Application d'arguments : [Positionnels uniquement / | Mots-clés uniquement *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
98100

99101
3. **Structures de données**
100102
    - Liste : [Opérations sur les listes](ultimatepython/data_structures/list.py) ( 🍰 )
101103
    - Tuple : [Opérations sur les tuples](ultimatepython/data_structures/tuple.py)
102104
    - Ensemble : [Opérations sur les ensembles](ultimatepython/data_structures/set.py)
103105
    - Dictionnaire : [Opérations sur les dictionnaires](ultimatepython/data_structures/dict.py) ( 🍰 )
106+
- Union de dictionnaires : [Fusion de dictionnaires | et |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
104107
    - Compréhension : [list | tuple | set | dict](ultimatepython/data_structures/comprehension.py)
105108
    - Chaîne : [Opérations sur les chaînes](ultimatepython/data_structures/string.py) ( 🍰 )
106109
    - Deque : [deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -131,12 +134,13 @@ Deux méthodes sont possibles :
131134
    - Expressions régulières : [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
132135
    - Format de données : [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
133136
    - Date et heure : [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
137+
- Correspondance de motifs : [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
134138

135139
## Ressources supplémentaires
136140

137-
👔 = Ressource d’entretien 
138-
🧪 = Exemples de code 
139-
🧠 = Idées de projets 
141+
👔 = Ressource d’entretien
142+
🧪 = Exemples de code
143+
🧠 = Idées de projets
140144

141145
### Dépôts GitHub
142146

README.hi.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ print("Ultimate Python स्टडी गाइड")
6969
- कंडीशनल: [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
7070
- लूप: [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
7171
- फ़ंक्शन: [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
72+
- वॉलरस ऑपरेटर: [असाइनमेंट एक्सप्रेशन :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
73+
- तर्क प्रवर्तन: [केवल स्थितीय / | केवल कीवर्ड *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
7274
3. **डेटा संरचनाएँ**
7375
- लिसट: [लिसट ऑपरेशन्स](ultimatepython/data_structures/list.py) ( 🍰 )
7476
- ट्यूपल: [ट्यूपल ऑपरेशन्स](ultimatepython/data_structures/tuple.py)
7577
- सेट: [सेट ऑपरेशन्स](ultimatepython/data_structures/set.py)
7678
- डिक्ट: [डिक्शनरी ऑपरेशन्स](ultimatepython/data_structures/dict.py) ( 🍰 )
79+
- डिक्शनरी यूनियन: [डिक्शनरी मर्ज | और |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
7780
- संकलन: [लिसट | ट्यूपल | सेट | डिक्ट](ultimatepython/data_structures/comprehension.py)
7881
- स्ट्रिंग: [स्ट्रिंग ऑपरेशन्स](ultimatepython/data_structures/string.py) ( 🍰 )
7982
- डेक: [डेक](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -102,6 +105,7 @@ print("Ultimate Python स्टडी गाइड")
102105
- नियमित अभिव्यक्ति: [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
103106
- डेटा फ़ॉर्मेट: [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
104107
- दिनांक और समय: [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
108+
- पैटर्न मिलान: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
105109

106110

107111
## अतिरिक्त संसाधन

README.ko.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ print("Ultimate Python 학습 가이드")
7777
- 조건문 : [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
7878
- 반복문 : [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
7979
- 함수 : [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
80+
- 바다코끼리 연산자 : [할당 표현식 :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
81+
- 인수 강제 : [위치 전용 / | 키워드 전용 *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
8082
3. **데이터 구조**
8183
- 리스트 : [리스트 연산](ultimatepython/data_structures/list.py) ( 🍰 )
8284
- 튜플 : [튜플 연산](ultimatepython/data_structures/tuple.py)
8385
- 세트 : [세트 연산](ultimatepython/data_structures/set.py)
8486
- 딕셔너리 : [딕셔너리 연산](ultimatepython/data_structures/dict.py) ( 🍰 )
87+
- 딕셔너리 합병 : [딕셔너리 병합 | 및 |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
8588
- 컴프리헨션 : [리스트 | 튜플 | 세트 | 딕셔너리](ultimatepython/data_structures/comprehension.py)
8689
- 문자열 : [문자열 연산](ultimatepython/data_structures/string.py) ( 🍰 )
8790
- 덱: [deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -110,6 +113,7 @@ print("Ultimate Python 학습 가이드")
110113
- 정규식 : [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
111114
- 데이터 포맷 : [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
112115
- 날짜와 시간 : [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
116+
- 패턴 매칭: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
113117

114118
## 추가 자료
115119

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,14 @@ There are two ways of running the modules:
8989
- Conditional: [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
9090
- Loop: [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
9191
- Function: [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
92+
- Walrus operator: [Assignment expressions :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
93+
- Argument enforcement: [Positional-only / | Keyword-only *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
9294
3. **Data Structures**
9395
- List: [List operations](ultimatepython/data_structures/list.py) ( 🍰 )
9496
- Tuple: [Tuple operations](ultimatepython/data_structures/tuple.py)
9597
- Set: [Set operations](ultimatepython/data_structures/set.py)
9698
- Dict: [Dictionary operations](ultimatepython/data_structures/dict.py) ( 🍰 )
99+
- Dict union: [Dictionary merge | and |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
97100
- Comprehension: [list | tuple | set | dict](ultimatepython/data_structures/comprehension.py)
98101
- String: [String operations](ultimatepython/data_structures/string.py) ( 🍰 )
99102
- Deque: [deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -122,6 +125,7 @@ There are two ways of running the modules:
122125
- Regular expression: [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
123126
- Data format: [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
124127
- Datetime: [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
128+
- Pattern matching: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
125129

126130
## Additional resources
127131

README.pt_br.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ Existem duas maneiras de rodar os módulos:
7575
- Condicional: [if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
7676
- Loop/Laço: [for-loop | while-loop](ultimatepython/syntax/loop.py) ( 🍰 )
7777
- Função: [def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
78+
- Operador morsa: [Expressões de atribuição :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
79+
- Aplicação de argumentos: [Somente posicional / | Somente palavra-chave *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
7880
3. **Estrutura de dados**
7981
- Lista: [Operações de lista](ultimatepython/data_structures/list.py) ( 🍰 )
8082
- Tupla: [Operações de tuplas](ultimatepython/data_structures/tuple.py)
8183
- Conjunto: [Operações de conjuntos](ultimatepython/data_structures/set.py)
8284
- Dicionário: [Operações de dicionários](ultimatepython/data_structures/dict.py) ( 🍰 )
85+
- União de dicionários: [Fusão de dicionários | e |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
8386
- Comprehension: [list | tuple | set | dict](ultimatepython/data_structures/comprehension.py)
8487
- String: [Operações de String](ultimatepython/data_structures/string.py) ( 🍰 )
8588
- Deque: [deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -108,6 +111,7 @@ Existem duas maneiras de rodar os módulos:
108111
- Expressões regulares (regexp): [search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
109112
- Formato de dados: [json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
110113
- Datetime: [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
114+
- Correspondência de padrões: [match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
111115

112116
## Recursos adicionais
113117

README.zh_tw.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ print("Ultimate Python 學習大綱")
7272
- 條件運算式:[if | if-else | if-elif-else](ultimatepython/syntax/conditional.py) ( 🍰 )
7373
- 迴圈:[for迴圈 | while迴圈](ultimatepython/syntax/loop.py) ( 🍰 )
7474
- 定義函式:[def | lambda](ultimatepython/syntax/function.py) ( 🍰 )
75+
- 海象運算子:[賦值表達式 :=](ultimatepython/syntax/walrus_operator.py) ( 🤯 )
76+
- 參數強制:[僅位置 / | 僅關鍵字 *](ultimatepython/syntax/arg_enforcement.py) ( 🤯 )
7577
3. **資料結構**
7678
- 列表:[列表操作](ultimatepython/data_structures/list.py) ( 🍰 )
7779
- 元組:[元組操作](ultimatepython/data_structures/tuple.py)
7880
- 集合:[集合操作](ultimatepython/data_structures/set.py)
7981
- 字典:[字典操作](ultimatepython/data_structures/dict.py) ( 🍰 )
82+
- 字典聯合:[字典合併 | 和 |=](ultimatepython/data_structures/dict_union.py) ( 🤯 )
8083
- 綜合:[list | tuple | set | dict](ultimatepython/data_structures/comprehension.py)
8184
- 字串:[字串操作](ultimatepython/data_structures/string.py) ( 🍰 )
8285
- 雙端隊列:[deque](ultimatepython/data_structures/deque.py) ( 🤯 )
@@ -104,6 +107,7 @@ print("Ultimate Python 學習大綱")
104107
- 正規表示式:[search | findall | match | fullmatch](ultimatepython/advanced/regex.py) ( 🤯 )
105108
- 數據格式:[json | xml | csv](ultimatepython/advanced/data_format.py) ( 🤯 )
106109
- 日期時間: [datetime | timezone](ultimatepython/advanced/date_time.py) ( 🤯 )
110+
- 模式匹配:[match | case](ultimatepython/advanced/pattern_matching.py) ( 🤯 )
107111

108112
## 額外資源
109113

codecov.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# https://docs.codecov.com/docs/commit-status
33
coverage:
44
status:
5+
project:
6+
default:
7+
target: 90%
58
patch:
69
default:
7-
target: 100%
10+
target: 90%

0 commit comments

Comments
 (0)