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
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.9k
第3木曜LT会 #28
tinykitten
PRO
0
110
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
210
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
770
セグメントとターゲットを意識するプロポーザルの書き方 〜採択の鍵は、誰に刺すかを見極めるマーケティング戦略にある〜
m3m0r7
PRO
0
530
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
120
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
3
320
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
Kingdom of the Machine
yui_knk
2
210
Swift Concurrency Type System
inamiy
0
520
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
330
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
270
AI: The stuff that nobody shows you
jnunemaker
PRO
6
570
Being A Developer After 40
akosma
91
590k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
4 Signs Your Business is Dying
shpigford
187
22k
Thoughts on Productivity
jonyablonski
76
5.1k
Marketing to machines
jonoalderson
1
5.2k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
480
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
200
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