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
AIを導入する前にやるべきこと
negima
2
310
個人的に嬉しかったpnpmの新機能・3選
matsuo_atsushi
0
110
🦞OpenClaw works with AWS
licux
1
310
tRPCの概要と少しだけパフォーマンス
misoton665
2
250
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
190
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
890
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
300
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2k
Road to RubyKaigi: Play Hard(ware)
makicamel
1
500
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
Programming with a DJ Controller — not vibe coding
m_seki
3
650
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
280
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
360
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
120
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
480
AI: The stuff that nobody shows you
jnunemaker
PRO
6
610
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
330
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
390
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