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
88
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
More Decks by Hideo Hattori
See All by Hideo Hattori
gocloc
hhatto
0
580
RustとPython
hhatto
4
2.6k
PHP Kansai 2013 LT
hhatto
0
100
Other Decks in Programming
See All in Programming
[RVD26] Vibe Architecture en 2040 : Darwin a-t-il (enfin) eu raison des architectes ?
alexandretouret
0
110
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
550
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
360
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.6k
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
180
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
240
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
270
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.8k
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
140
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
160
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
320
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Documentation Writing (for coders)
carmenintech
77
5.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
740
Visualization
eitanlees
152
17k
The Curious Case for Waylosing
cassininazir
1
440
Product Roadmaps are Hard
iamctodd
55
12k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
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