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
65
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
510
RustとPython
hhatto
4
2.3k
PHP Kansai 2013 LT
hhatto
0
82
Other Decks in Programming
See All in Programming
HTML/CSS超絶浅い説明
yuki0329
0
140
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
650
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
480
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
380
Оптимизируем производительность блока Казначейство
lamodatech
0
850
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
110
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
140
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
390
快速入門可觀測性
blueswen
0
470
Spatial Rendering for Apple Vision Pro
warrenm
0
310
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
200
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
700
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Producing Creativity
orderedlist
PRO
343
39k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
18
2.3k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
We Have a Design System, Now What?
morganepeng
51
7.3k
How to train your dragon (web standard)
notwaldorf
88
5.8k
Building Your Own Lightsaber
phodgson
104
6.1k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Typedesign – Prime Four
hannesfritz
40
2.5k
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