Skip to content

Documentation from inspect.getdoc() for non-callable attributes math.e can be misleading. #135316

Closed as duplicate of#104042
@astrolamb-gaming

Description

@astrolamb-gaming

Bug report

Bug description:

inspect module returns wrong documentation for math.e.

print(inspect.getdoc(math.e))
# Returns: 
# "Convert a string or number to a floating point number, if possible."

This should return something to the effect of:
"""
Returns the nearest representable value to the mathematical constant e, which has a value of 2.718281..." and is the base of natural logorithms.
"""

CPython versions tested on:

3.11

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions