Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

W504: positional only / keyword only argument marker at end of long line

オープン
#951 コメント 3 件 リアクション 8 件 担当者 0 名 GitHub で見る

@Jackenmen がすでに取り組んでいます。

2022年9月11日 から。

  • #1098 @Jackenmen による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

positional-only argument の例で W504 を再現し、コンマによる回避策と比較します。リポジトリ内にある単一の Python ファイルでの W504 の処理を追跡し、その後、スラッシュが二項演算子として扱われなくなっている一方で、二項演算子の後の実際の改行では引き続き W504 が報告されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Configuraton:

  • OS: Arch Linux
  • pycodestyle version: 2.6.0
  • Python version: 3.8.3
  • Installation source: Arch Linux packages

W504 (line break after binary operator) shows up when the slash that indicates positional-only arguments (PEP 570) is followed by a newline. For example:

def really_long_name_for_a_function(
    very_long_argument_1, very_long_argument_2, /
):
    pass

pycodestyle thinks that the slash is a binary operator. I can, however, silence it using a comma after the slash, as follows:

def really_long_name_for_a_function(
    very_long_argument_1, very_long_argument_2, /,
):
    pass

I think this is an issue, as the slash isn't a binary operator, and the comma seems like a workaround for arguments on a single line than good practice (at least in this case).

主要言語
Python
スター
5.2k
フォーク
756
平均マージ
5時間 56分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PyCQA/pycodestyle のほかの issue

PyCQA/pycodestyle の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。