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
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
43
Unit Tests and Mocks: Testing in Python
aylakhan
0
33
Other Decks in Technology
See All in Technology
RelayerというPHPのフレームワークを作った
polidog
PRO
0
100
LLM Internals: 언어 모델의 계보와 알고리즘 진화 (2023~2026)
inureyes
PRO
1
830
属人化を叩き割れ!「制作加速」と「安定化」の矛盾を打破する:8年目プロダクトが辿り着いた「ミスが起こり得ない」アセット制作フローの全貌
gree_tech
PRO
0
120
AI画像認識を活用したゲーム内決済処理検証の自動化
gree_tech
PRO
0
110
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.7k
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
260
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.6k
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.2k
도구에서 동료까지: 10년차 AI 스타트업의 AI 적응기
inureyes
PRO
1
310
ソフトウェアサプライチェーンの構造的リスクとコンテナ環境の保護
kyohmizu
5
760
AI時代のアウトプット――変わったこと、変わらないこと / Devsumi 2026 Kansai #devsumi
jnchito
0
430
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
9.3k
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
How to make the Groovebox
asonas
2
2.3k
Skip the Path - Find Your Career Trail
mkilby
1
190
Fireside Chat
paigeccino
42
4k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
300
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
570
Done Done
chrislema
186
16k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
300
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
420
GitHub's CSS Performance
jonrohan
1033
470k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
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