protocolbuffers / protocolbuffers/protocolbuffers.github.io

Protocol Buffer Basics: Python refers to __metaclass__ but there is none of that in the code snippet

Offen
#256 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@jguamie arbeitet bereits daran.

Seit 17.10.2025.

Vorherrschende Sprache
HTML
Sterne
69
Forks
179
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Looking at the rendered output of the Python Tutorial today, I see the following paragraph, which still references __metaclass__. I think some more cleanup in needed, but I'm not sure what...

The important line in each class is __metaclass__ = reflection.GeneratedProtocolMessageType. While the details of how Python metaclasses work is beyond the scope of this tutorial, you can think of them as like a template for creating classes. At load time, the GeneratedProtocolMessageType metaclass uses the specified descriptors to create all the Python methods you need to work with each message type and adds them to the relevant classes.

It looks like some cleanup was done in response to #124 in commit 654b896, but there are still some lingering references to __metaclass__ that makes the documentation confusing.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.