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
Respect the Built-in Names
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
HayaoSuzuki
September 08, 2017
Technology
5.1k
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
Transcript
9 slides
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
More Decks by HayaoSuzuki
See All by HayaoSuzuki
Let's implement useless Python objects (revised)
hayaosuzuki
0
74
Tomorrow graphlib, Let us use everybody
hayaosuzuki
1
2.6k
Tasting "Python Distilled"
hayaosuzuki
0
430
Let's implement useless Python objects
hayaosuzuki
0
2.1k
How to Write Robust Python Code
hayaosuzuki
5
4.8k
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.6k
Do you know cmath module?
hayaosuzuki
0
3.4k
Other Decks in Technology
See All in Technology
閉域網でのAPI公開の選択肢全部比較!
takano0131
2
250
生成AI時代のIAMのマニアックな話
takuros
6
3.3k
AIが会計業務の伴走者に。 マネーフォワード クラウド会計MCPサーバーで実現するAI前提の新しい業務プロセス
nobitabashi
0
160
LLM 基盤と kagent v0 を全部 k8s に入れてみた / Deploy both LLM and kagent v0 in k8s
kota2and3kan
0
220
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
320
81天的 AI Agent 軟體開發團隊治理實務分享
regionbbs
0
170
マネージャーをエスパーにしない マネジメントされる側から始める、働きやすい現場づくり
comi190327
0
510
Sonnetだけで業務はまわる?
kintotechdev
1
130
Kansai WordPress Meetup@大阪『ブロックテーマを作る上で知っておくべきこと
torounit
0
110
農家は秘伝のタレを知らない - NOBODY KNOWS THE HIDDEN SOURCE - Kaggriculture 3rd Place Solution
masspeaks
0
350
AI対話型分析を作成し、リリースするまでの話 / The Road to Release: Buiding AI Conversational Analytics
yappli_developers
0
140
Kiro アップデート 2026 年 11 月号 (11 月 8 日時点) | 目指せ Kiro マスター アップデート編
inariku
PRO
2
130
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
Amusing Abliteration
ianozsvald
1
390
The Mindset for Success: Future Career Progression
greggifford
PRO
0
560
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
330
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
750
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
480
The agentic SEO stack - context over prompts
schlessera
0
1k