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
Re: Respect the Built-in Names
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
momijiame
September 09, 2017
Science
2.1k
0
Share
Re: Respect the Built-in Names
PyCon JP 2017 Day2 LT
momijiame
September 09, 2017
More Decks by momijiame
See All by momijiame
SphinxCon JP 2015 - Sphinxで電子書籍を書こうと色々やってみた
momijiame
2
22k
Other Decks in Science
See All in Science
Physical AIを支えるWeights & Biases
olachinkei
1
250
データマイニング - ウェブとグラフ
trycycle
PRO
0
270
Non-Gaussian, nonlinear causal discovery with hidden variables and application
sshimizu2006
0
100
論文紹介 音源分離:SCNET SPARSE COMPRESSION NETWORK FOR MUSIC SOURCE SEPARATION
kenmatsu4
0
590
データマイニング - ノードの中心性
trycycle
PRO
0
360
アクシズを探せ! 各勢力の位置関係についての考察
miu_crescent
PRO
1
190
2025-06-11-ai_belgium
sofievl
1
250
(メタ)科学コミュニケーターからみたAI for Scienceの同床異夢
rmaruy
0
190
会社でMLモデルを作るとは @電気通信大学 データアントレプレナーフェロープログラム
yuto16
1
610
先端因果推論特別研究チームの研究構想と 人間とAIが協働する自律因果探索の展望
sshimizu2006
3
860
MCMCのR-hatは分散分析である
moricup
0
630
学術講演会中央大学学員会府中支部
tagtag
PRO
0
370
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Google's AI Overviews - The New Search
badams
0
960
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
170
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Designing for Timeless Needs
cassininazir
0
190
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Balancing Empowerment & Direction
lara
5
1k
Transcript
Re: Respect the Built-in Names ~ ੩తίʔυղੳπʔϧͷ׆༻ ~ PyCon JP
2017 Day2 LT (2017/9/9) @momijiame
͓લɺ୭Α • Twitter: @momijiame • Blog: http://blog.amedama.jp/ • Book: εϚʔτPythonϓϩάϥϛϯά
• Proposal: ࣮ફSQLAlchemy (མબ)
͜ͷ LT ͷ͖͔͚ͬ • PyCon JP 2017 Day1 LT •
@CardinalXaro ͞Μ • λΠτϧ: Respect the Built-in Names • ༰: ϏϧτΠϯؔʹਓݖ͋Δʂ
ਓݖ৵ͷྫ def max(elements): … def f(id, name): … str =
'Hello, World!'
͋Δ͋Δ…
ͦΜͳʹ͋Δ͋ΔͳΒ ࣗಈͰνΣοΫ͍ͨ͠
ຊͷϝΠϯςʔϚ
੩తίʔυղੳπʔϧͷ׆༻
੩తίʔυղੳπʔϧͱʁ • ιʔείʔυΛ੩తʹղੳ͢Δπʔϧͷ͜ͱ • ੩త: ιʔείʔυΛ࣮ࡍʹಈ͔͞ͳ͍ • యܕతʹ AST (நߏ)
Λղੳ͢Δ • ಈత: ιʔείʔυΛ࣮ࡍʹಈ͔ͯ͠ΈΔ
πʔϧΛͬͨͱ͖ͷخ͠͞ • νΣοΫͯ͘͠ΕΔ͜ͱͷྫ • ίʔσΟϯάελΠϧʹԊ͍ͬͯΔ͔ʁ • όάͷݪҼͱͳΔΑ͏ͳهड़ͳ͍͔ʁ • ਓݖ৵͍ͯ͠ͳ͍͔ʁ
Pylint • Ϡό͍ॻ͖ํͯ͠Δͱڭ͑ͯ͘ΕΔ • ͘͢͝ྑ͍πʔϧ͚ͩͲӨ͕ബ͍ (ؾ͕͢Δ) $ pip install pylint
࣮ߦྫ • ઌ΄Ͳͷਓݖ৵શͯ Pylint Ͱर͑Δ $ pylint --disable=R,C overwrite.py No
config file found, using default configuration ************* Module overwrite W: 1, 0: Redefining built-in 'str' (redefined-builtin) …(লུ)
ͱ͜ΖͰɺਓݖ৵Λ ݟ͚ͭͨͱ͖Ͳ͏͢Εʁ
࣮ରॲํ๏͕ PEP8 ʹʂ single_trailing_underscore_: used by convention to avoid conflicts
with Python keyword, e.g. Tkinter.Toplevel(master, class_='ClassName') https://www.python.org/dev/peps/pep-0008/
ࣦΘΕͨਓݖΛऔΓͨ͠ྫ def max_(elements): … def f(id_, name): … str_ =
'Hello, World!'
·ͩ·ͩ͋ΔΑʂ • ศརͳ੩తղੳπʔϧͨͪ • pycodestyle (چ pep8 / ίʔσΟϯάελΠϧνΣοΧ) •
pydocstyle (چ pep257 / ίʔσΟϯάελΠϧνΣοΧ) • Flake8 (ϓϥΨϒϧͳઃܭͷ൚༻੩తίʔυղੳπʔϧ) • Radon (ίʔυͷෳࡶΛఆྔతʹଌఆ) • autopep8, yapf (ίʔυϑΥʔϚολ)
πʔϧΛ͏্ͰͷϙΠϯτ • ॏཁ: ࣗಈͰνΣοΫ͕࣮ߦ͞ΕΔΑ͏ʹ͢Δ • ΤσΟλͱ౷߹͢Δ • อଘ࣌ʹࣗಈͰνΣοΫ͞ΕΔͱ͔ • CI
ʹΈࠐΉ • ϓογϡ͢ΔͱࣗಈͰνΣοΫ͞ΕΔͱ͔
·ͱΊ • ੩తίʔυղੳπʔϧΛຯํʹ͚ͭΑ͏ • ਓݖ৵͕ى͖ͦ͏ͳͱ͖ޙΖʹ '_' ͚ͭΔ • ৭ʑͳ੩తղੳπʔϧ͕͋Δ •
ҙࣝ͠ͳͯ͘πʔϧ͕ΔΈ͕ॏཁ
͋Γ͕ͱ͏͍͟͝·ͨ͠