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
AgentCore Optimizationを始めよう!
licux
3
240
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
390
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
1.9k
Making the RBS Parser Faster
soutaro
0
710
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.7k
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.7k
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
510
AIと共に生きる技術選定 2026
sgash708
0
140
Firefoxにコントリビューションして得られた学び
ken7253
2
160
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
170
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
要はバランスからの卒業 #yumemi_grow
kajitack
0
150
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Fireside Chat
paigeccino
42
3.9k
The Language of Interfaces
destraynor
162
26k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The SEO Collaboration Effect
kristinabergwall1
1
440
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Side Projects
sachag
455
43k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
520
WCS-LA-2024
lcolladotor
0
590
ラッコキーワード サービス紹介資料
rakko
1
3.3M
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3k
Agile that works and the tools we love
rasmusluckow
331
21k
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