Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Python Type Hints
Search
Ayla Khan
May 16, 2018
Technology
44
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Python Type Hints
PyLadies lightning talk about Python type hints
Ayla Khan
May 16, 2018
More Decks by Ayla Khan
See All by Ayla Khan
Getting started with docker + python
aylakhan
0
24
Productive Bash
aylakhan
1
45
Unit Tests and Mocks: Testing in Python
aylakhan
0
33
Other Decks in Technology
See All in Technology
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
230
LTのテーマ どうきめてる?〜5つの型と私のやり方〜
yama3133
1
110
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
210
山手線を徒歩で一周してわかった、 位置情報アプリは「足」が最強のデバッガー
hinakko
0
170
HHKBエバンジェリストになる方法
941
0
110
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
140
AIエージェントの権限管理 3: Agentic RAG の Fine grained access control 編
ren8k
0
130
C#コードの結合を可視化する Roslyn解析による設計改善と リファクタリング判断
dora56
0
170
.NET WebAssemblyで実現するクライアントサイドAI推論:NuGetからViteまで、2つのエコシステムを繋ぐビルド戦略
yamachu
0
210
積み重なった技術負債への挑戦 〜初手としての全社ゴト化〜
techtekt
PRO
0
1.4k
白金鉱業Meetup Vol.25 アウトカムが二値のデータに対するCausal Impact
brainpadpr
0
250
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
190
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
YesSQL, Process and Tooling at Scale
rocio
174
15k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Become a Pro
speakerdeck
PRO
31
6.3k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.1k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Mind Mapping
helmedeiros
1
360
The Mindset for Success: Future Career Progression
greggifford
PRO
0
500
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