Skip to content

docs: add container types documentation (#3349) - #10775

Merged
esc merged 16 commits into
numba:mainfrom
coderay3000:docs/container-types-3349
Aug 19, 2026
Merged

esc merged 16 commits into
numba:mainfrom
coderay3000:docs/container-types-3349

Conversation

@coderay3000

Copy link
Copy Markdown
Contributor

Description

This PR adds documentation for Numba's strongly-typed containers (ListType and DictType) under a new Containers section in docs/source/reference/types.rst.

Changes Made

  • Added a Containers subsection under Types and signatures in types.rst.
  • Added directive-based documentation (.. class::) and usage examples for numba.types.ListType and numba.types.DictType.
  • Applied standard reStructuredText (RST) formatting aligned with existing reference documentation.

Related Issue

Closes #3349


AI / LLM Disclosure

Google Gemini was used as an AI assistant to help format the reStructuredText (.rst) syntax and verify doc directives. All generated content and formatting were manually reviewed and validated prior to submission.

@coderay3000

Copy link
Copy Markdown
Contributor Author

Update on CI failure:

The Sphinx build in CI was failing due to an undefined reference label (undefined label: 'withobjmode').

I have updated line 121 in types.rst to format numba.objmode as an inline code block instead of using an invalid :ref: tag. The Sphinx build issue is now resolved.

@coderay3000

Copy link
Copy Markdown
Contributor Author

Hi @swap357,

I've resolved all the CI check failures:

  • Fixed the Sphinx broken reference label issue by formatting numba.objmode as an inline code block.
  • Renamed the release note fragment to 10775.doc.rst matching the PR ID.

All checks are now green. Please review when you get a chance!

@kc611

kc611 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Hi @coderay3000,

Thank you for PR and making contributions to Numba!

Could you please address the errors on the CI jobs ?

This can be done by making the Release Note of form:

<Heading>
-----------

<Description>

For example: https://github.com/numba/numba/blob/main/docs/upcoming_changes/10528.bug_fix.rst

@coderay3000

Copy link
Copy Markdown
Contributor Author

Hi @kc611,

Thank you! I have updated the release note fragment (10775.doc.rst) to follow the proper heading format (<Heading> with underline) and minimum line requirements. All CI checks are now passing!

@kc611
kc611 requested a review from esc August 18, 2026 14:35

@esc esc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderay3000 thank you for submitting this PR!

I would like to request three changes:

a) The containers are documented already: https://numba.readthedocs.io/en/stable/reference/pysupported.html#typed-list -- so just mention the types here and then create a link to the already exitsting documentation.

b) There is also a typed set, please add that type here too.

c) The towncrier snippet is incorrectly formatted, please take a look and fix this.

Feel free to followup with questions, in case the above is not clear.

@esc esc added 4 - Waiting on author Waiting for author to respond to review and removed 2 - In Progress labels Aug 18, 2026

@swap357 swap357 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a problem with sample on DictType-

Comment thread docs/source/reference/types.rst Outdated

>>> from numba import types, typed
>>> dict_type = types.DictType(types.unicode_type, types.int64)
>>> typed.Dict.empty_dict(types.unicode_type, types.int64)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sample here is incorrect. There's no typed.Dict.empty_dict:

>>> from numba import types, typed
>>> dict_type = types.DictType(types.unicode_type, types.int64)
>>> typed.Dict.empty_dict(types.unicode_type, types.int64)
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    typed.Dict.empty_dict(types.unicode_type, types.int64)
    ^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Dict' has no attribute 'empty_dict'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @esc mentioned, the documentation with sample snippets is on - https://numba.readthedocs.io/en/stable/reference/pysupported.html
that can be used as reference.

@coderay3000

Copy link
Copy Markdown
Contributor Author

Hi @esc,

Thanks for the detailed review! I have updated the PR according to your suggestions:

  • Containers & Links: Updated types.rst to document ListType, DictType, and SetType with direct :ref: links pointing to their existing documentation sections.
  • Typed Set: Included numba.types.SetType alongside ListType and DictType.
  • Towncrier Snippet: Properly created and formatted the release note snippet at docs/upcoming_changes/10775.doc.rst.

All changes have been committed and pushed. Please take a look when you get a chance!

@coderay3000

Copy link
Copy Markdown
Contributor Author

Hi @swap357,

Thanks for pointing that out!

As per the feedback from you and @esc, I have completely removed the sample code snippets from types.rst and replaced them with direct cross-references (:ref:) pointing to the existing documentation in pysupported.html.

The updated changes are pushed and ready for review!

@coderay3000
coderay3000 requested review from esc and swap357 August 18, 2026 16:50

@esc esc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates, one final nitpick to resolve, then OK to merge!

Thank you for the patch ❤️

Comment thread docs/upcoming_changes/10775.doc.rst Outdated

@esc esc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This underline style is to be preferred.

Comment thread docs/upcoming_changes/10775.doc.rst Outdated
coderay3000 and others added 2 commits August 19, 2026 01:02
Co-authored-by: Emergency Self-Construct <esc@users.noreply.github.com>
Co-authored-by: Emergency Self-Construct <esc@users.noreply.github.com>
Comment thread docs/upcoming_changes/10775.doc.rst Outdated
@@ -0,0 +1,4 @@
Document container types in reference manual
-----------------------------------------------------------

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so sorry, this needs to be the same length as the text above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all! I've updated the underline length to match the title exactly. Thanks @esc!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but you used = instead of -...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see, you fixed it later on, thank you.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're welcome! Apologies for the initial confusion with the formatting and references. I've updated everything according to the guidelines, and all CI checks are green now.

Thanks a lot for your patience and guidance!

@coderay3000
coderay3000 requested a review from esc August 18, 2026 20:04
@swap357
swap357 dismissed their stale review August 18, 2026 20:29

requested changes were made

@esc esc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch!

@esc
esc merged commit 41fbb29 into numba:main Aug 19, 2026
24 checks passed
@coderay3000

Copy link
Copy Markdown
Contributor Author

Happy to contribute! Thanks for merging.

@coderay3000
coderay3000 deleted the docs/container-types-3349 branch August 19, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 - Waiting on author Waiting for author to respond to review doc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the container types

4 participants