graphql-python / graphql-python/graphene

Is it necessary to prevent a datasclass field name from being a Python keyword?

オープン
#1,348 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
✨ enhancement
主要言語
Python
スター
8.2k
フォーク
818
PR マージ指標
30日以内にマージされた PR はありません

説明

I ran into this error when dynamically creating an dataclass:

"Field names must not be keywords: {name!r}"
https://github.com/graphql-python/graphene/blob/master/graphene/pyutils/dataclasses.py#L1196-L1197

The field names come from a defined external dataset, and one field name happens to be a Python keyword, but I don't think that causes any harm.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reading graphene/pyutils/dataclasses.py around lines 1196–1197 and trace how dynamically created dataclass field names are handled. Determine whether rejecting Python keywords is required for this path and define the expected behavior for field names from external datasets before identifying the necessary coverage.

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

評価

技術スタック
python
領域
backend-api-design
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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