In one module, I have code such as:
class ConfigParsers:
def str(raw, key):
# parse value as a string
# other parsers
class Section(dict):
def add_parsers(name, parsers):
"""Add a parser
:param str name: the name of the object
...
...
When sphinx builds the documentation for this module using autodoc, "str" gets linked to the current pages' ConfigParsers.str
rather than the python documention. This occurs with other built in types where the name collision is within a class, such as int and bool. I can understand the collision if the parsers were defined at the module level, however Sphinx is forming a collision even when the definition is within a class, like above.
Edit:
A work around I have just found entails using the new intersphinx mapping format, and then using identifierusedforstdlibcode:str
, however this isn't ideal, and normally wouldn't be an issue as sphinx usually autolinks it already to an extent.