Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

"is_default" is not unique per species

未关闭
#1,568 4 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
python

调研方向

先从 PokemonForm 文档和 issue 中引用的 pokemon.csv 数据开始,然后追踪 API 如何公开 is_default 和 form_order。在确定替换规则之前,先查看现有注释。只有在主要形态的行为达成一致、完成实现并记录文档,且没有让当前字段的语义含糊不清时,才算完成。

由索引模型根据 Issue 内容生成。

描述

The PokemonForm documentation describes is_default as

True for exactly one form used as the default for each Pokémon.

Of the 249 Pokémon with more than one form in pokemon.csv, 222 of them have more than one form with is_default set to True.

While the easiest fix would just be to purge these secondary is_default forms, I think that field should just be deprecated and replaced with a different method of determining the primary form. I have to imagine this field is not widely used by API consumers, as it would not work for its documented purpose.

My preferred design would be to simply have the form of the species with the first form ID be the primary form. It looks like there isn't strictly a form_id field, but it roughly corresponds to the form_order field. So my suggestion would be to just define that the form of the Pokémon with the smallest value in form_order is considered the default form.

主要语言
Python
星标
5.4k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PokeAPI/pokeapi 的其他 Issue

查看 PokeAPI/pokeapi 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。