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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
HayaoSuzuki
September 08, 2017
Technology
4.9k
0
Share
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
40
Tomorrow graphlib, Let us use everybody
hayaosuzuki
1
1.7k
Tasting "Python Distilled"
hayaosuzuki
0
370
Let's implement useless Python objects
hayaosuzuki
0
2k
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.4k
How to Use In-Memory Streams
hayaosuzuki
1
6.4k
Do you know cmath module?
hayaosuzuki
0
3.3k
Other Decks in Technology
See All in Technology
Pythonでベイズモデリング
soogie
0
180
基礎から解説!Icebergで紐解くSnowflake×Databricks連携の現在地
cm_yasuhara
0
240
AI全盛の今だからこそ、あえてもう一度振り返るAPIの基礎
smt7174
3
160
DI コンテナ自動生成ツールを実装してみた / intro-autodi
uhzz
0
850
コーディングAIが導くリスクベースド探索的テストの実践
lycorptech_jp
PRO
1
390
AI とサービス・デザイン / AI and Service Design
ks91
PRO
0
120
Amazon CloudFrontにおけるAIボットアクセス制御のポイント
kizawa2020
4
240
はじめてのAI-DLC
yoshidashingo
2
470
GitHub Copilot のこれまでとこれから: From Copilot to Collaborative Agents
yuriemori
1
130
freee-mcpを Local→Remote で出してわかった MCP認可実装のリアル
terara
2
550
ジュニアエンジニアはSREとどう向き合うべきか
nrinetcom
PRO
1
120
コーポレートサイトのアクセシビリティ改善とJIS準拠への実践
lycorptech_jp
PRO
2
130
Featured
See All Featured
Writing Fast Ruby
sferik
630
63k
HDC tutorial
michielstock
2
670
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
The Invisible Side of Design
smashingmag
302
52k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
130
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
530
Mind Mapping
helmedeiros
PRO
1
200
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Raft: Consensus for Rubyists
vanstee
141
7.4k
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