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
プログラマのための作曲入門
cheebow
0
540
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.4k
CSC305 Lecture 01
javiergs
PRO
1
400
Local Peer-to-Peer APIはどのように使われていくのか?
hal_spidernight
2
450
止められない医療アプリ、そっと Swift 6 へ
medley
1
120
Model Pollution
hschwentner
1
180
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
180
Breaking Up with Big ViewModels — Without Breaking Your Architecture (droidcon Berlin 2025)
steliosf
PRO
1
330
あなたの知らない「動画広告」の世界 - iOSDC Japan 2025
ukitaka
0
380
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
130
CSC305 Lecture 03
javiergs
PRO
0
230
Featured
See All Featured
Designing for Performance
lara
610
69k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Six Lessons from altMBA
skipperchong
28
4k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.5k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.6k
Practical Orchestrator
shlominoach
190
11k
4 Signs Your Business is Dying
shpigford
185
22k
Site-Speed That Sticks
csswizardry
11
880
How GitHub (no longer) Works
holman
315
140k
GitHub's CSS Performance
jonrohan
1032
460k
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