Skip to content

docs: Fix method links in btree.rst #17648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

koxudaxi
Copy link

@koxudaxi koxudaxi commented Jul 9, 2025

Summary

This pull request renames the values attribute in the btree module to resolve a name conflict.

The issue came up when building the documentation with Sphinx, where btree.values conflicted with string.templatelib.Template.values, causing the build to fail.

This change was originally part of my work in PR #17557. As suggested by @AJMansfield in the review comments, I've moved it into its own separate pull request to keep the changes focused and unrelated to the t-string support.

Testing

I have confirmed that with this change, the documentation now builds successfully using Sphinx without any errors.

Since this change is limited to resolving a documentation build issue, it has no impact on the runtime code or any board-specific functionality.

Signed-off-by: Koudai Aono <koxudaxi@gmail.com>
@koxudaxi koxudaxi force-pushed the docs/btree-method-refs branch from d940e45 to b3cf1f8 Compare July 9, 2025 17:42
@AJMansfield
Copy link
Contributor

AJMansfield commented Jul 10, 2025

For other reviewers: note that this fixes a latent problem that only becomes evident if you add another rst document for something else that also has a values in its namespace, such as the planned docs/library/string.templatelib.rst from #17557.

When adding the above file to e.g. df05cae, and running make -C micropython/docs html, this produces the error:

~/micropython/docs/library/btree.rst:154: WARNING: more than one target found for 'any' cross-reference 'values()': could be :py:meth:`btree.btree.values` or :py:attr:`string.templatelib.Template.values`
~/micropython/docs/library/btree.rst:159: WARNING: more than one target found for 'any' cross-reference 'values()': could be :py:meth:`btree.btree.values` or :py:attr:`string.templatelib.Template.values`

@AJMansfield
Copy link
Contributor

Noting the change to the rendered output.

The current document renders as:

Constants

btree.INCL

A flag for keys(), values(), items() methods to specify that scanning should be inclusive of the end key.

btree.DESC

A flag for keys(), values(), items() methods to specify that scanning should be in descending direction of keys.

While the modified document renders as:

Constants

btree.INCL

A flag for btree.keys(), btree.values(), btree.items() methods to specify that scanning should be inclusive of the end key.

btree.DESC

A flag for btree.keys(), btree.values(), btree.items() methods to specify that scanning should be in descending direction of keys.

@Josverl
Copy link
Contributor

Josverl commented Jul 11, 2025

In my experience in parsing the .rst to create the MicroPython stub files, there are several different practices used wrt notation of method and class names.

I personally think the 2nd one is more explicit and clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy