Skip to content

Conversation

@flamiedev
Copy link

@flamiedev flamiedev commented Oct 17, 2024

What was wrong?

Related to Issue #1628
Closes #1628

How was it fixed?

Created a new web3.types.rst file in the docs to list all the possible type hints available in the types file.

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@flamiedev flamiedev marked this pull request as draft October 17, 2024 12:44
@pacrob
Copy link
Contributor

pacrob commented Oct 19, 2024

Hey @flamiedev , thanks for getting this started! I'd rather we went in an auto-generated direction, that way we don't have to remember to update across both places when changes happen in the future.

Just to get you started:

  1. Add types to docs/toc.rst, probably in the API section, under constants
...
.. toctree::
    :maxdepth: 1
    :caption: API

    web3.main
    web3.eth
    web3.beacon
    web3.net
    web3.geth
    web3.tracing
    web3.utils
    gas_price
    ens
    constants
    types
...
  1. Create docs/types.rst with the following in it:
Types
=====

.. automodule:: web3.types
    :members:

Then when you build the docs, you'll see all the classes from types.py in there. The initial request specifically mentions mappings, so I'd like to see the members of each of these TypedDicts, along with their types. I'm not sure how to pull those out directly, or you may just need to add docstrings to the classes themselves. Docstrings would be helpful to give a brief explanation of what each TypedDict is used for, especially if it's not clear from the name.

@pacrob
Copy link
Contributor

pacrob commented Dec 2, 2024

Hey, @flamiedev, are you planning to continue work here? Happy to leave it open if you are, but it can be closed if you've moved on.

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.

Add documentation for TypedDict return values of methods usable by 3rd parties

2 participants