Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PyCon APAC 2013 LT
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Hideo Hattori
September 15, 2013
Programming
100
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
Transcript
14 slides
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
More Decks by Hideo Hattori
See All by Hideo Hattori
gocloc
hhatto
0
590
RustとPython
hhatto
4
2.7k
PHP Kansai 2013 LT
hhatto
0
120
Other Decks in Programming
See All in Programming
てっくりーどのおしごと in Swift愛好会 #101
yuukiw00w
2
110
Skills Are the New npm [AAIF Bengaluru, Nov 2026]
shivamsaraswat
0
140
高橋メソッドでCVE解説シリーズ 〜CVE-2026-112816〜
hakkadaikon
0
280
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
1
1.3k
はじめてのKubernetesコントリビューション
nasa9084
0
330
LambdaなのにVM?Lambda MicroVMsを調べてみた / About Lambda Micro VMs
ak2ie
2
110
Datadog を OTel にするメリットを考察する — Datadog との併用を実アプリで確かめる / Examining the Benefits of Moving Datadog to OTel — Testing OTel Alongside Datadog in a Real App
seike460
PRO
1
120
SODA - FACT BOOK(EN)
sodainc
1
310
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
650
Lean で手続き的プログラム の証明が書けるようになった
inoueasei
11
6.1k
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
260
Featured
See All Featured
HDC tutorial
michielstock
2
1k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
310
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.3k
Git: the NoSQL Database
bkeepers
PRO
433
67k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
580
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
620
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
630