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
46
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
Transcript
13 slides
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
More Decks by Ayla Khan
See All by Ayla Khan
Getting started with docker + python
aylakhan
0
25
Productive Bash
aylakhan
1
48
Unit Tests and Mocks: Testing in Python
aylakhan
0
34
Other Decks in Technology
See All in Technology
Is the Website Dying?
miriamschwab
0
160
ブース設計、 お前もプロダクトだったのか / So Booth Design Was a Product All Along
akihiro0038
0
150
Terraform 0 to 100:100個以上のリポジトリを常に最新にし続けるための自動化
sue445
3
1.4k
ポケモンバトルのAIエージェント
koji_kawamura
0
220
セキュリティチームは どのコンテナイメージの脆弱性対応を優先すべきか 〜CISA新指針とSCCで作る脆弱性トリアージ〜
swdtkuy
0
330
成長するID管理基盤における運用もコストも犠牲にしないオブザーバビリティ向上の実践 / Improving Observability for a Growing Identity Platform Without Adding Operational Burden or Cost
kaminashi
1
130
NutanixへのSSHアクセスの今後について
shadowhat
0
170
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
280
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
5
610
新規事業開発でのAWS活用成功談&失敗談! 〜新規事業開発を専門に行うRelicならではのAWS活用〜
amixedcolor
1
140
SBOM 生成ツールで 2026 Minimum Elements はどこまで満たせるのか
gokken
0
160
Amazon EFS のマルウェアスキャンをClamAV で自前実装したら苦労した話
mtmtfactory01
0
110
Featured
See All Featured
The browser strikes back
jonoalderson
0
2k
The Language of Interfaces
destraynor
162
27k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1.1k
Designing for Timeless Needs
cassininazir
1
570
First, design no harm
axbom
PRO
2
1.4k
How STYLIGHT went responsive
nonsquared
100
6.4k
Embracing the Ebb and Flow
colly
88
5.2k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
Making the Leap to Tech Lead
cromwellryan
135
10k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k