You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tensorstore documentation theme changes sphinx.domains.python.PyXrefMixin.make_xrefs to just use _parse_annotation, so that the formatting of types is the same in both signatures and in the field lists (e.g. "parameters", "return type", "raises" listings):
Currently make_xrefs has a separate implementation, perhaps to accommodate more free-form syntax used in older parameter type specifications before the introduction of type annotations, like "int or float":
I think the older-style "int or float" style should be discourage now that type annotations are so widely used. However, if it is desired to still support them, make_xrefs should still dispatch to _parse_annotations so that real type annotations are displayed consistently.
The text was updated successfully, but these errors were encountered:
Reasonable. It would be better to support new-style annotations. At the same time, we also support old-styled old-styled type explanations written by narrative. I believe they should be also supported. I believe they're legacy. So it's better to add an option to switch the behavior.
Sub-issue split off from #9523.
The tensorstore documentation theme changes
sphinx.domains.python.PyXrefMixin.make_xrefs
to just use_parse_annotation
, so that the formatting of types is the same in both signatures and in the field lists (e.g. "parameters", "return type", "raises" listings):https://github.com/google/tensorstore/blob/1a59fcb310bc1feb13569f03f7134b4c3a5fa5f4/docs/tensorstore_sphinx_ext/autodoc.py#L76
Currently
make_xrefs
has a separate implementation, perhaps to accommodate more free-form syntax used in older parameter type specifications before the introduction of type annotations, like "int or float":sphinx/sphinx/domains/python.py
Line 331 in ba2439a
I think the older-style "int or float" style should be discourage now that type annotations are so widely used. However, if it is desired to still support them,
make_xrefs
should still dispatch to_parse_annotations
so that real type annotations are displayed consistently.The text was updated successfully, but these errors were encountered: