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

[Enhancement] Add a Clear method to the Message class for compatibility.

Aperta
#511 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia con la classe astratta Message e la logica esistente di parsing e dei valori predefiniti; confronta il loro comportamento con quello di protobuf standard, inclusi i valori predefiniti definiti dall’utente. Il lavoro è completato quando un metodo clear reimposta tutti i campi ai relativi valori predefiniti e supporta il lavoro di compatibilità descritto in #323 e #336.

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

Descrizione

enhancement low priority

When converting existing code to use this module over standard protobuf, one issue raised was the lack of ParseFromString. This has already been mentioned at #323, with a PR in the works at #336. However, this is blocked because it does not perform the same calls as the standard, namely, Clear. In my use of this module, i have worked around this issue by simply creating a new instance (which is always the default) instead of using an existing one, at which point just calling parse works fine.

Ideally, we'd need a clear function (preferably lowercase to match python syntax, but might want TitleCase for compatibility) on the abstract Message class and an implementation that resets all fields to their default values. We'd need to confirm that our implementation matches standard protobuf when it comes to user-defined default values.

to be clear, this isn't a bug, and it doesn't prevent the use of this module.
I'd look into addressing this myself but the logic used to set default values eludes me, at least at first glance.

Lingua principale
Python
Stelle
1.8k
Fork
235
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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 danielgtaylor/python-betterproto

Tutte le issue di danielgtaylor/python-betterproto

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.