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
PyCon APAC 2013 LT
Search
Hideo Hattori
September 15, 2013
Programming
94
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PyCon APAC 2013 LT
PEP 8 and autopep8
Hideo Hattori
September 15, 2013
More Decks by Hideo Hattori
See All by Hideo Hattori
gocloc
hhatto
0
580
RustとPython
hhatto
4
2.7k
PHP Kansai 2013 LT
hhatto
0
110
Other Decks in Programming
See All in Programming
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
620
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
430
ソフトウェアラスタライザ
fadis
1
780
KotlinConf Extended South Korea 2026 Keynote
l2hyunwoo
0
130
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
360
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
1
460
Foundry Localでエージェント開発
seosoft
0
120
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
140
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
800
不幸な GC
chencmd
0
870
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
My Marp Sample
sinoue0108
0
140
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
970
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
The browser strikes back
jonoalderson
0
1.6k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
640
The untapped power of vector embeddings
frankvandijk
2
1.9k
Test your architecture with Archunit
thirion
2
2.4k
Code Reviewing Like a Champion
maltzj
528
40k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
WENDY [Excerpt]
tessaabrams
12
39k
Transcript
PEP 8 and autopep8 PyCon APAC 2013 LT / 2013.09.15
Hideo Hattori
whoami C/Python/Zsh My Python Projects , , , ... code
on , @hhatto pgmagick otamapy genzshcomp meow Github Bitbucket
PEP 8 coding conventions for the Python code Nc”úùk1 Õúß
Õc v ”c v göpvz̈v©–− 2013.08.01 •ò&\©¤ http://www.python.org/dev/peps/pep- 0008/
PEP 8 modernisation 1 m¤ß”5ðcv •9¡−l¡ ׳•9¡−l¡ Python1.5.2 •9¡−l¡w£Œ\©–¤ß Python2/3
•9¡−l¡wûl\©¤ß http://hg.python.org/peps/rev/fb24c80e9afb
About autopep8 simple command-line tool automatic formatting for Python Code
require v0.9.4 (2013.09.08) pep8 $ pip install autopep8
For Example invalid PEP 8 code import sys, os n
= True if n != None: print("none") def f(x): return 2 * x
Output Auto-Formatting Code $ autopep8 invalid.py import sys import os
n = True if n != None: print("none") def f(x): return 2 * x
Aggressive $ autopep8 -a invalid.py import sys import os n
= True if n is not None: print("none") def f(x): return 2 * x
Print Diff $ autopep8 -d invalid.py --- original/invalid.py +++ fixed/invalid.py
@@ -1,7 +1,10 @@ -import sys, os +import sys +import os n = True if n != None: print("none") -def f(x): return 2 * x + +def f(x): + return 2 * x
Other Feature ignore/select errors max-line recursive/jobs
ofiØ#”O •PEP 8 ³
⁄¿autopep8 ³³›–Æ–z“\o
https://github.com/hhatto/autopep8
Thank you