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.8k
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
Tomorrow graphlib, Let us use everybody
hayaosuzuki
1
420
Tasting "Python Distilled"
hayaosuzuki
0
320
Let's implement useless Python objects
hayaosuzuki
0
1.9k
How to Write Robust Python Code
hayaosuzuki
5
4.5k
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.7k
Do you know cmath module?
hayaosuzuki
0
3.3k
Elementary Number Theory with Python
hayaosuzuki
1
3.5k
Other Decks in Technology
See All in Technology
ソフトウェアテストのAI活用_ver1.50
fumisuke
0
290
Claude Code 10連ガチャ
uhyo
2
620
AI-ready"のための"データ基盤 〜 LLMOpsで事業貢献するための基盤づくり
ismk
0
150
us-east-1 の障害が 起きると なぜ ソワソワするのか
miu_crescent
PRO
1
690
ピープルウエア x スタートアップ
operando
3
3.8k
3年ぶりの re:Invent 今年の意気込みと前回の振り返り
kazzpapa3
0
190
今のコンピュータ、AI にも Web にも 向いていないので 作り直そう!!
piacerex
0
800
技術の総合格闘技!?AIインフラの現在と未来。
ebiken
PRO
0
240
AIと共に開発する時代の組織、プロセス設計 freeeでの実践から見えてきたこと
freee
3
510
Design and implementation of "Markdown to Google Slides" / phpconfuk 2025
k1low
1
390
AI時代に必要なデータプラットフォームの要件とは by @Kazaneya_PR / 20251107
kazaneya
PRO
4
950
Data Engineering Guide 2025 #data_summit_findy by @Kazaneya_PR / 20251106
kazaneya
PRO
11
2.1k
Featured
See All Featured
For a Future-Friendly Web
brad_frost
180
10k
KATA
mclloyd
PRO
32
15k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
We Have a Design System, Now What?
morganepeng
54
7.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Typedesign – Prime Four
hannesfritz
42
2.9k
Music & Morning Musume
bryan
46
6.9k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Statistics for Hackers
jakevdp
799
220k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
The World Runs on Bad Software
bkeepers
PRO
72
12k
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