Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

"is_default" is not unique per species

Aperta
#1,568 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

Inizia dalla documentazione di PokemonForm e dai dati pokemon.csv citati nell’issue, quindi traccia il modo in cui l’API espone is_default e form_order. Esamina i commenti esistenti prima di stabilire la regola di sostituzione. Il lavoro è completato quando il comportamento della forma primaria è concordato, implementato e documentato, senza lasciare ambigua la semantica del campo attuale.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
5.4k
Fork
1.2k
Merge medio
2g 12h
PR unite (30g)
18

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PokeAPI/pokeapi

Tutte le issue di PokeAPI/pokeapi

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.