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
Respect the Built-in Names
Search
HayaoSuzuki
September 08, 2017
Technology
5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Respect the Built-in Names
PyCon JP 2017 Day1 Lightning Talk
HayaoSuzuki
September 08, 2017
More Decks by HayaoSuzuki
See All by HayaoSuzuki
Let's implement useless Python objects (revised)
hayaosuzuki
0
55
Tomorrow graphlib, Let us use everybody
hayaosuzuki
1
2.2k
Tasting "Python Distilled"
hayaosuzuki
0
410
Let's implement useless Python objects
hayaosuzuki
0
2.1k
How to Write Robust Python Code
hayaosuzuki
5
4.7k
Unknown Evolution of the Built-in Function pow
hayaosuzuki
0
1.5k
Python for Everyday
hayaosuzuki
1
2.5k
How to Use In-Memory Streams
hayaosuzuki
1
6.5k
Do you know cmath module?
hayaosuzuki
0
3.4k
Other Decks in Technology
See All in Technology
DINO-EdgeQuery:Edge-First Polygon Decoding for Building Footprint Extraction from Satellite Imagery
lehupa
0
140
Instana&Bob トラブルシュートハンズオン
mayamasaki68
0
110
AI時代におけるプロダクト横断勉強会の設計
zozotech
PRO
0
150
魔法少女がClaude Codeを監視する / ccportal-deck
noriyukitakei
3
130
「重なり」は迎える側がつくる ― 人もAIエージェントも歓迎するプロダクトエンジニアリング ―
go0517go
PRO
0
220
AIエージェントの開発・提供におけるセキュリティリスクの論点と対策
flatt_security
1
530
AI時代に、プロダクトの数だけ積み上がる所有コストをどうエンジニアリングするか / Engineering the Cost of Ownership
kzkmaeda
0
940
Level Up Your CDK DX: 5 Tools I’ve Been Building
gotok365
2
190
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
0
120
[RSJ26] Building a VLA Model Based on Self-Distilled Classification
keio_smilab
PRO
0
190
Claude Codeの体系的な理解と知識のフック
oikon48
10
6.6k
スクラムで身についていた動き方を、XPで捉え直してみた
codmoninc
1
170
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Test your architecture with Archunit
thirion
2
2.4k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
220
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Deep Space Network (abreviated)
tonyrice
0
290
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
230
Color Theory Basics | Prateek | Gurzu
gurzu
0
450
Measuring & Analyzing Core Web Vitals
bluesmoon
9
990
Transcript
Respect the Built-in Names Hayao Suzuki PyCon JP 2017 Lightning
Talk at Waseda Univ. September 8, 2017
Who Am I? About Me Name Hayao Suzuki (@CardinalXaro) Blog
http://xaro.hatenablog.jp/ Major Mathematics (Combinatorics, Number Theory) Work Python Programmer at iRidge, Inc. Reviewed Books Effective Python (O’Reilly Japan) ΞϧΰϦζϜΫΠοΫϦϑΝϨϯε ୈ 2 ൛ (O’Reilly Japan) ॳΊͯͷ PHP (O’Reilly Japan) Effective Debugging (O’Reilly Japan) ͢Β͢ΒΘ͔Δ Python ʢᠳӭࣾʣ Python ͱ JavaScript Ͱ͡ΊΔσʔλϏδϡΞϥΠθʔγϣϯ (O’Reilly Japan) 2 / 9
Today’s Theme Respect the Built-in Names 3 / 9
Examples sum is a name of built-in function but... sum
= 0 for i in range(10): sum = sum + i print(sum) sum ͷೖѱ͍จ໌ʂʂ 4 / 9
Examples id is a name of built-in function but... id
= 12345 name = "Ξϧςϥ" print(f"Α͏ͦ͜{name}͞Μ (id={id})") id ͷೖѱ͍จ໌ʂʂ 5 / 9
Examples list is a name of sequence class but... list
= [1, 2, 3, 4, 5] for i in range(len(list)): print(list[i]) list ͷೖѱ͍จ໌ʂʂ 6 / 9
Examples dict is a name of mapping class but... dict
= {"spam": 0, "egg": 1, "bacon":2} for k, v in dict.items(): print("%s: %s" % (k, v)) dict ͷೖѱ͍จ໌ʂʂ 7 / 9
Examples json is a name of built-in module but... import
json import requests response = requests.get("https://examples.com") if response.status_code == 200: json = response.json() print(json.keys()) json ͷೖѱ͍จ໌ʂʂ 8 / 9
Conclusion Respect the built-in names Abuse of names causes a
trouble. If you provide objects with the same name as a built-in value, read builtins module’s documents. 9 / 9