-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Extra () after NewType #216
Comments
This is working as expected, the Hexstr is not a class, but a new type instance that makes a restriction in strings. https://docs.python.org/3/library/typing.html#newtype The one thing that does seem strange is a superfluous () after new type. |
Can I somehow instruct |
No, that would be contrary to the current design philosophy. The same way type aliases are extended this is too. One could add a flag for this but adding such feature might be quite involved PR, you're free to try to create that. |
Thank you so much @gaborbernat - I am choosing not to fight on this hill for now. |
I'll keep this issue open to remove the extra |
I am maintaining some Python API documentation for Ethereum and Web3.py ecosystem.
To improve the readability of the API documentation, I stumbled upon on your very useful
sphinx-autodoc-typehints
plugin. IMHO I feel this should be a core feature for apidocs.I am generating some docs on Python 3.9 that use "custom" types. However, an unnecessary
NewType()
appears in the generated doc output. This comes form the custom types defined in eth-typing modules.Any way to suppress this or hack around this?
Here is the function signature.:
Here is the example output:
The text was updated successfully, but these errors were encountered: