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
0
4.7k
Respect the Built-in Names
PyCon JP 2017 Day1 Lightning Talk
HayaoSuzuki
September 08, 2017
Tweet
Share
More Decks by HayaoSuzuki
See All by HayaoSuzuki
Tasting "Python Distilled"
hayaosuzuki
0
300
Let's implement useless Python objects
hayaosuzuki
0
1.9k
How to Write Robust Python Code
hayaosuzuki
5
4.4k
Unknown Evolution of the Built-in Function pow
hayaosuzuki
0
1.4k
Python for Everyday
hayaosuzuki
1
2.2k
How to Use In-Memory Streams
hayaosuzuki
1
5.4k
Do you know cmath module?
hayaosuzuki
0
3.3k
Elementary Number Theory with Python
hayaosuzuki
1
3.5k
Django QuerySet "ARE" Patterns
hayaosuzuki
0
3.3k
Other Decks in Technology
See All in Technology
DuckDB-Wasmを使って ブラウザ上でRDBMSを動かす
hacusk
1
130
KINTO FACTORYから学ぶ生成AI活用戦略
kintotechdev
0
130
【 LLMエンジニアがヒューマノイド開発に挑んでみた 】 - 第104回 Machine Learning 15minutes! Hybrid
soneo1127
0
180
microCMS 最新リリース情報(microCMS Meetup 2025)
microcms
0
270
帳票Vibe Coding
terurou
0
150
役割は変わっても、変わらないもの 〜スクラムマスターからEMへの転身で学んだ信頼構築の本質〜 / How to build trust
shinop
0
110
現場が抱える様々な問題は “組織設計上” の問題によって生じていることがある / Team-oriented Organization Design 20250827
mtx2s
7
61k
広島銀行におけるAWS活用の取り組みについて
masakimori
0
160
人と組織に偏重したEMへのアンチテーゼ──なぜ、EMに設計力が必要なのか/An antithesis to the overemphasis of people and organizations in EM
dskst
6
690
開発と脆弱性と脆弱性診断についての話
su3158
1
1.2k
7月のガバクラ利用料が高かったので調べてみた
techniczna
3
750
AIエージェントの開発に必須な「コンテキスト・エンジニアリング」とは何か──プロンプト・エンジニアリングとの違いを手がかりに考える
masayamoriofficial
0
470
Featured
See All Featured
KATA
mclloyd
32
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Automating Front-end Workflow
addyosmani
1370
200k
Scaling GitHub
holman
463
140k
Building an army of robots
kneath
306
46k
Fireside Chat
paigeccino
39
3.6k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Into the Great Unknown - MozCon
thekraken
40
2k
Bash Introduction
62gerente
614
210k
Code Reviewing Like a Champion
maltzj
525
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
570
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