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
0
76
PyCon APAC 2013 LT
PEP 8 and autopep8
Hideo Hattori
September 15, 2013
Tweet
Share
More Decks by Hideo Hattori
See All by Hideo Hattori
gocloc
hhatto
0
540
RustとPython
hhatto
4
2.5k
PHP Kansai 2013 LT
hhatto
0
91
Other Decks in Programming
See All in Programming
はじめてのMaterial3 Expressive
ym223
2
250
🔨 小さなビルドシステムを作る
momeemt
3
670
ソフトウェアテスト徹底指南書の紹介
goyoki
1
150
為你自己學 Python - 冷知識篇
eddie
1
350
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
19
11k
OSS開発者という働き方
andpad
5
1.7k
Navigating Dependency Injection with Metro
zacsweers
3
230
Ruby Parser progress report 2025
yui_knk
1
430
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
210
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
270
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
22
11k
Namespace and Its Future
tagomoris
6
700
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
53
7.8k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Into the Great Unknown - MozCon
thekraken
40
2k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Building Applications with DynamoDB
mza
96
6.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Balancing Empowerment & Direction
lara
3
620
Mobile First: as difficult as doing things right
swwweet
224
9.9k
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