SlideShare a Scribd company logo
Python 3.10の新機能を
俯瞰してみる
Python駿河 勉強会 #28 ~真夏のLT大会~
2021/08/28@オンライン
あっきー
自己紹介
● 株式会社KYOSO勤務
○ IoTのワンストップサービスなど
● 業務では主に、AWS、SORACOM、
AIカメラを使ったサービスを提供
● バックエンド、フロントエンド両方好き
● 推し言語はPythonとTypeScript
● VTuber好き、Dead by Daylight好き
AWS LambdaにPython 3.9来たよー🎉
本日お話しする内容
先日Python 3.10 RCが公開されたのでその内容をざっくりとみていきたいと思いま
す
発表時間が5分なので駆け足で進めますのであしからず
https://docs.python.org/3.10/whatsnew/3.10.html
目次
https://docs.python.org/3.10/whatsnew/3.10.html
Structural Pattern Matching
● PEP 634, Structural Pattern Matching: Specification
● PEP 635, Structural Pattern Matching: Motivation and Rationale
● PEP 636, Structural Pattern Matching: Tutorial
パターンマッチという新しい文法が追加された
これまでもIF,ELIF,ELSEを用いて同様のことが実現可能だったが、よりわかりやすく
記述することが可能になった
Structural Pattern Matching
従来の記法 パターンマッチ使った場合
Parenthesized context managers
● bpo-12782, Parenthesized context managers are now officially allowed.
複数のファイルをオープンしたいときなどに使うwith、かっこを使ってまとめること
ができるようになったよ
じつは3.9でも動いていたけど公式採用されたよ
Parenthesized context managers
従来の記法 新しい記法
Add Optional Length-Checking To zip
● PEP 618, Add Optional Length-Checking To zip
ZIP関数使うときはほとんどが引数の長さが同じ
逆に長さが異なっている場合に発生する不具合の特定が非常に困難なので何と
かしたい
ということで、引数の長さをチェックするstrictフラグ追加したよ
Add Optional Length-Checking To zip
Add Optional Length-Checking To zip
Precise line numbers for debugging and other
tools
● PEP 626, Precise line numbers for debugging and other tools.
これまでデバッガツールなどで表示される行番号が想定と異なる場合があった
が、正確な行番号が表示されるように修正
行番号を取得するf_linenoオブジェクトの動作を改善???
※これに関しては正確に内容が理解できなかったので間違ってたらすみませ
ん。。。。
Allow writing union types as X | Y
● PEP 604, Allow writing union types as X | Y
Union[X, Y] を X | Y って書けるようにしました
Allow writing union types as X | Y
従来の記法
新しい記法
Parameter Specification Variables
● PEP 612, Parameter Specification Variables
typingにParamSpecを追加しました。
デコレータ等でより詳細な型指定ができます。
詳細な解説をすると時間超えそうなので省略、、、
TypeAlias
● PEP 613: TypeAlias
typingにTypeAlias追加しました

More Related Content

Similar to Python 3.10の新機能を 俯瞰してみる

PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)
HemaArora2
 
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Edureka!
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptx
Kaviya452563
 
IRJET- Why Python Rocks for Research....???
IRJET- Why Python Rocks for Research....???IRJET- Why Python Rocks for Research....???
IRJET- Why Python Rocks for Research....???
IRJET Journal
 
what is python ?
what is python ? what is python ?
what is python ?
NetmaxTechnologies1
 
python_tutorial.pdf
python_tutorial.pdfpython_tutorial.pdf
python_tutorial.pdf
amgadmonir1
 
Python 3 - Tutorialspoint Full Cource Book.pdf
Python 3 - Tutorialspoint Full Cource Book.pdfPython 3 - Tutorialspoint Full Cource Book.pdf
Python 3 - Tutorialspoint Full Cource Book.pdf
AbdikadirAbdirahman4
 
Python_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdfPython_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdf
bhagyashri686896
 
Python_vision_academy notes
Python_vision_academy notes Python_vision_academy notes
Python_vision_academy notes
rajaniraut
 
Python_final_print_batch_II_vision_academy (1).pdf
Python_final_print_batch_II_vision_academy (1).pdfPython_final_print_batch_II_vision_academy (1).pdf
Python_final_print_batch_II_vision_academy (1).pdf
rupaliakhute
 
Python_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdfPython_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdf
sannykhopade
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
SudhanshiBakre1
 
Python Programming Draft PPT.pptx
Python Programming Draft PPT.pptxPython Programming Draft PPT.pptx
Python Programming Draft PPT.pptx
LakshmiNarayanaReddy48
 
Python training in mysore
Python training in mysorePython training in mysore
Python training in mysore
PragadeeshvaranSubra
 
Why Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.pptWhy Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.ppt
Techinventive Software
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdf
VisionAcademyProfSac
 
SRT Prometheus Exporter Introduction.pdf
SRT Prometheus Exporter Introduction.pdfSRT Prometheus Exporter Introduction.pdf
SRT Prometheus Exporter Introduction.pdf
Tomoya Fujita
 
Introduction to python3.pdf
Introduction to python3.pdfIntroduction to python3.pdf
Introduction to python3.pdf
Mohammed Aman Nawaz
 
Python. Why to learn?
Python. Why to learn?Python. Why to learn?
Python. Why to learn?
Oleh Korkh
 
Getting Started with Python
Getting Started with PythonGetting Started with Python
Getting Started with Python
Emily Dong
 

Similar to Python 3.10の新機能を 俯瞰してみる (20)

PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)PYTHON FOR BEGINNERS (BASICS OF PYTHON)
PYTHON FOR BEGINNERS (BASICS OF PYTHON)
 
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
Python Scripting Tutorial for Beginners | Python Tutorial | Python Training |...
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptx
 
IRJET- Why Python Rocks for Research....???
IRJET- Why Python Rocks for Research....???IRJET- Why Python Rocks for Research....???
IRJET- Why Python Rocks for Research....???
 
what is python ?
what is python ? what is python ?
what is python ?
 
python_tutorial.pdf
python_tutorial.pdfpython_tutorial.pdf
python_tutorial.pdf
 
Python 3 - Tutorialspoint Full Cource Book.pdf
Python 3 - Tutorialspoint Full Cource Book.pdfPython 3 - Tutorialspoint Full Cource Book.pdf
Python 3 - Tutorialspoint Full Cource Book.pdf
 
Python_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdfPython_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdf
 
Python_vision_academy notes
Python_vision_academy notes Python_vision_academy notes
Python_vision_academy notes
 
Python_final_print_batch_II_vision_academy (1).pdf
Python_final_print_batch_II_vision_academy (1).pdfPython_final_print_batch_II_vision_academy (1).pdf
Python_final_print_batch_II_vision_academy (1).pdf
 
Python_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdfPython_final_print_batch_II_vision_academy.pdf
Python_final_print_batch_II_vision_academy.pdf
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Python Programming Draft PPT.pptx
Python Programming Draft PPT.pptxPython Programming Draft PPT.pptx
Python Programming Draft PPT.pptx
 
Python training in mysore
Python training in mysorePython training in mysore
Python training in mysore
 
Why Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.pptWhy Python is the Best Coding Language For PWA Development_.ppt
Why Python is the Best Coding Language For PWA Development_.ppt
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdf
 
SRT Prometheus Exporter Introduction.pdf
SRT Prometheus Exporter Introduction.pdfSRT Prometheus Exporter Introduction.pdf
SRT Prometheus Exporter Introduction.pdf
 
Introduction to python3.pdf
Introduction to python3.pdfIntroduction to python3.pdf
Introduction to python3.pdf
 
Python. Why to learn?
Python. Why to learn?Python. Why to learn?
Python. Why to learn?
 
Getting Started with Python
Getting Started with PythonGetting Started with Python
Getting Started with Python
 

More from hiroya akita

KyotoLT_Online_27.pdf
KyotoLT_Online_27.pdfKyotoLT_Online_27.pdf
KyotoLT_Online_27.pdf
hiroya akita
 
はんなりPython #45
はんなりPython #45はんなりPython #45
はんなりPython #45
hiroya akita
 
KyotoLT(Online) 第26回
KyotoLT(Online) 第26回KyotoLT(Online) 第26回
KyotoLT(Online) 第26回
hiroya akita
 
AppSync導入のすすめ
AppSync導入のすすめAppSync導入のすすめ
AppSync導入のすすめ
hiroya akita
 
みんなのPython勉強会#62
みんなのPython勉強会#62みんなのPython勉強会#62
みんなのPython勉強会#62
hiroya akita
 
はんなりpython#32
はんなりpython#32はんなりpython#32
はんなりpython#32
hiroya akita
 
Hannari python#27
Hannari python#27Hannari python#27
Hannari python#27
hiroya akita
 
変数の重要度ってどうやったらわかるん?
変数の重要度ってどうやったらわかるん?変数の重要度ってどうやったらわかるん?
変数の重要度ってどうやったらわかるん?
hiroya akita
 
みんなのはんなりPython勉強会
みんなのはんなりPython勉強会みんなのはんなりPython勉強会
みんなのはんなりPython勉強会
hiroya akita
 
Pythonでも型をつけたいだけの人生だった
Pythonでも型をつけたいだけの人生だったPythonでも型をつけたいだけの人生だった
Pythonでも型をつけたいだけの人生だった
hiroya akita
 
Lt debian 20190526
Lt debian 20190526Lt debian 20190526
Lt debian 20190526
hiroya akita
 

More from hiroya akita (11)

KyotoLT_Online_27.pdf
KyotoLT_Online_27.pdfKyotoLT_Online_27.pdf
KyotoLT_Online_27.pdf
 
はんなりPython #45
はんなりPython #45はんなりPython #45
はんなりPython #45
 
KyotoLT(Online) 第26回
KyotoLT(Online) 第26回KyotoLT(Online) 第26回
KyotoLT(Online) 第26回
 
AppSync導入のすすめ
AppSync導入のすすめAppSync導入のすすめ
AppSync導入のすすめ
 
みんなのPython勉強会#62
みんなのPython勉強会#62みんなのPython勉強会#62
みんなのPython勉強会#62
 
はんなりpython#32
はんなりpython#32はんなりpython#32
はんなりpython#32
 
Hannari python#27
Hannari python#27Hannari python#27
Hannari python#27
 
変数の重要度ってどうやったらわかるん?
変数の重要度ってどうやったらわかるん?変数の重要度ってどうやったらわかるん?
変数の重要度ってどうやったらわかるん?
 
みんなのはんなりPython勉強会
みんなのはんなりPython勉強会みんなのはんなりPython勉強会
みんなのはんなりPython勉強会
 
Pythonでも型をつけたいだけの人生だった
Pythonでも型をつけたいだけの人生だったPythonでも型をつけたいだけの人生だった
Pythonでも型をつけたいだけの人生だった
 
Lt debian 20190526
Lt debian 20190526Lt debian 20190526
Lt debian 20190526
 

Recently uploaded

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Hematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood CountHematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood Count
shahdabdulbaset
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
Madan Karki
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
MiscAnnoy1
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 

Recently uploaded (20)

Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Hematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood CountHematology Analyzer Machine - Complete Blood Count
Hematology Analyzer Machine - Complete Blood Count
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 
Introduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptxIntroduction to AI Safety (public presentation).pptx
Introduction to AI Safety (public presentation).pptx
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 

Python 3.10の新機能を 俯瞰してみる