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
Tasting "Python Distilled"
hayaosuzuki
0
310
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.5k
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
機械学習を扱うプラットフォーム開発と運用事例
lycorptech_jp
PRO
0
220
生成AI時代のデータ基盤設計〜ペースレイヤリングで実現する高速開発と持続性〜 / Levtech Meetup_Session_2
sansan_randd
1
150
AWSを利用する上で知っておきたい名前解決のはなし(10分版)
nagisa53
9
2.9k
大「個人開発サービス」時代に僕たちはどう生きるか
sotarok
20
9.6k
20250910_障害注入から効率的復旧へ_カオスエンジニアリング_生成AIで考えるAWS障害対応.pdf
sh_fk2
3
190
バッチ処理で悩むバックエンドエンジニアに捧げるAWS Glue入門
diggymo
3
180
【実演版】カンファレンス登壇者・スタッフにこそ知ってほしいマイクの使い方 / 大吉祥寺.pm 2025
arthur1
1
580
クラウドセキュリティを支える技術と運用の最前線 / Cutting-edge Technologies and Operations Supporting Cloud Security
yuj1osm
2
310
Webアプリケーションにオブザーバビリティを実装するRust入門ガイド
nwiizo
3
680
Rustから学ぶ 非同期処理の仕組み
skanehira
1
130
DevIO2025_継続的なサービス開発のための技術的意思決定のポイント / how-to-tech-decision-makaing-devio2025
nologyance
1
360
Skrub: machine-learning with dataframes
gaelvaroquaux
0
120
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Site-Speed That Sticks
csswizardry
10
810
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Six Lessons from altMBA
skipperchong
28
4k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Visualization
eitanlees
148
16k
How to Ace a Technical Interview
jacobian
279
23k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Writing Fast Ruby
sferik
628
62k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
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