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.2k
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
14
Let's implement useless Python objects
hayaosuzuki
0
1k
How to Write Robust Python Code
hayaosuzuki
5
3k
Unknown Evolution of the Built-in Function pow
hayaosuzuki
0
1.1k
Python for Everyday
hayaosuzuki
1
1.4k
How to Use In-Memory Streams
hayaosuzuki
0
3.4k
Do you know cmath module?
hayaosuzuki
0
2.7k
Elementary Number Theory with Python
hayaosuzuki
1
3k
Django QuerySet "ARE" Patterns
hayaosuzuki
0
2.8k
Other Decks in Technology
See All in Technology
Hands-on Gemini, the Google DeepMind LLM
meteatamel
1
110
長期間TiDBを使ってきた話 @ 私たちはなぜNewSQLを使うのかTiDB選定5社が語る選定理由と活用LT / Experiences with TiDB Over Time
chibiegg
2
870
アクセス制御にまつわる改善 / Improving access control
itkq
0
510
Terraformあれやこれ/terraform-this-and-that
emiki
8
1.3k
20240416_devopsdaystokyo
kzkmaeda
1
210
Next'24 事例セッションの紹介とクラウド資格を活用したキャリア形成について語りMuscle
yasumuusan
1
430
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
110
レガシーをぶっ壊せ。AEONで始めるDevRelの話 / Qiita Night 2024-2-22
aeonpeople
3
1.2k
Kernel MemoryでAzure OpenAI Serviceとお手軽データソース連携
mitsuzono
1
180
コンパウンドスタートアップのためのスケーラブルでセキュアなInfrastructure as Codeパイプラインを考える / Scalable and Secure Infrastructure as Code Pipeline for a Compound Startup
yuyatakeyama
4
4.6k
データベース02: データベースの概念
trycycle
0
140
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
520
Featured
See All Featured
For a Future-Friendly Web
brad_frost
172
9k
How to Ace a Technical Interview
jacobian
272
22k
Atom: Resistance is Futile
akmur
259
25k
We Have a Design System, Now What?
morganepeng
43
6.7k
Practical Orchestrator
shlominoach
182
9.7k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
What's new in Ruby 2.0
geeforr
337
31k
The Invisible Customer
myddelton
114
12k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Faster Mobile Websites
deanohume
299
30k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
78
42k
Six Lessons from altMBA
skipperchong
21
3k
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