人生シーケンスブレイク

シーケンスブレイク(Sequence breaking、シークエンスブレイクとも)とは、テレビゲームにおいて開発が想定している攻略ルートを逸脱し、ショートカットする行為のことである。

flake8 で continuation line under-indented for visual indent [E128] が出る時

flake8でコーディングチェックを行っていると、continuation line under-indented for visual indent [E128] が出る時がある。

f:id:ShineSpark:20151115155229p:plain

Vim標準、もしくは jedi.vim 利用時の自動インデントに倣って入力してるつもりだが、flake8では例えば引数などは、第1引数の開始箇所に倣って第2, 第3引数の開始箇所をあわせていく必要がある。

@app.route('/add', methods=['POST'])
def add_entry():
    if not session.get('logged_in'):
        abort(401)
    g.db.execute('insert into entries (title, text) values(?, ?)',
                 [request.form['title'], request.form['text']])
    g.db.commit()
    flash('New entry was successfully posted')
    return redirect(url_for('show_entries'))

上記のように()内の引数の開始位置を揃えると警告が出なくなる。

みんなのPython 第4版

みんなのPython 第4版