protocolbuffers / protocolbuffers/protocolbuffers.github.io

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

Abierto
#256 1 comentario 0 reacciones 1 asignado Ver en GitHub

@jguamie ya está trabajando en esto.

Desde el 17/10/2025.

Lenguaje dominante
HTML
Estrellas
69
Forks
179
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.