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
82
0
Share
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
560
RustとPython
hhatto
4
2.6k
PHP Kansai 2013 LT
hhatto
0
99
Other Decks in Programming
See All in Programming
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
460
「速くなった気がする」をデータで疑う
senleaf24
0
170
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
330
Kingdom of the Machine
yui_knk
2
200
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
実践CRDT
tamadeveloper
0
560
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
240
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
3
320
JOAI2026 1st solution - heron0519 -
heron0519
0
130
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
130
의존성 주입과 모듈화
fornewid
0
130
アーキテクチャモダナイゼーションとは何か
nwiizo
17
5.1k
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.8k
Designing for Performance
lara
611
70k
Documentation Writing (for coders)
carmenintech
77
5.3k
Color Theory Basics | Prateek | Gurzu
gurzu
0
290
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.1k
WENDY [Excerpt]
tessaabrams
10
37k
We Are The Robots
honzajavorek
0
210
The World Runs on Bad Software
bkeepers
PRO
72
12k
Being A Developer After 40
akosma
91
590k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Believing is Seeing
oripsolob
1
110
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