Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python Type Hints
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ayla Khan
May 16, 2018
Technology
0
40
Python Type Hints
PyLadies lightning talk about Python type hints
Ayla Khan
May 16, 2018
Tweet
Share
More Decks by Ayla Khan
See All by Ayla Khan
Getting started with docker + python
aylakhan
0
21
Productive Bash
aylakhan
1
40
Unit Tests and Mocks: Testing in Python
aylakhan
0
29
Other Decks in Technology
See All in Technology
マルチプレーンGPUネットワークを実現するシャッフルアーキテクチャの整理と考察
markunet
2
240
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.2k
DevOpsエージェントで実現する!! AWS Well-Architected(W-A) を実現するシステム設計 / 20260307 Masaki Okuda
shift_evolve
PRO
3
610
作りっぱなしで終わらせない! 価値を出し続ける AI エージェントのための「信頼性」設計 / Designing Reliability for AI Agents that Deliver Continuous Value
aoto
PRO
2
280
生成AIの利用とセキュリティ /gen-ai-and-security
mizutani
1
1.6k
猫でもわかるKiro CLI(AI 駆動開発への道編)
kentapapa
0
130
マネージャー版 "提案のレベル" を上げる
konifar
22
15k
AIエージェント時代に備える AWS Organizations とアカウント設計
kossykinto
3
810
決済サービスを支えるElastic Cloud - Elastic Cloudの導入と推進、決済サービスのObservability
suzukij
2
610
タスク管理も1on1も、もう「管理」じゃない ― KiroとBedrock AgentCoreで変わった"判断の仕事"
yusukeshimizu
5
2.6k
IBM Bobを使って、PostgreSQLのToDoアプリをDb2へ変換してみよう/202603_Dojo_Bob
mayumihirano
1
320
us-east-1 に障害が起きた時に、 ap-northeast-1 にどんな影響があるか 説明できるようになろう!
miu_crescent
PRO
13
4.2k
Featured
See All Featured
Music & Morning Musume
bryan
47
7.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Unsuck your backbone
ammeep
672
58k
Writing Fast Ruby
sferik
630
63k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
310
For a Future-Friendly Web
brad_frost
183
10k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
220
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
470
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
860
First, design no harm
axbom
PRO
2
1.1k
Transcript
Python (3.5+) Type Hints Using Type Aliases
What Are Python Type Hints? • New in 3.5 (provisional)
• PEP484 • Optional (not enforced at runtime) ◦ Linter use recommended instead • Function annotations • Type Aliases, NewType, Callable, Generics ...
Type Alias
Type Alias Linting
Type Alias At Runtime
Type Alias
Type Alias At Runtime
Type Alias
Type Alias
Type Alias (Any type, implicit)
Type Alias (Any type, implicit)
Type Hints Advantages • Clarifies, “enforces” intent • Improves readability
◦ Simplifies type signatures • Improves testability • May prevent bugs
Type Hints Disadvantages • Lose dynamic typing flexibility • Syntax
complexity