protocolbuffers / protocolbuffers/protocolbuffers.github.io

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

Open
#256 1 comment 0 reactions 1 assignee View on GitHub

@jguamie is already working on this.

Since Oct 17, 2025.

Dominant language
HTML
Stars
69
Forks
179
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.