Skip to content

[regression] inspect.getdoc not returning docstring. #84767

Closed

Description

@Carreau
mannequin
BPO 40587
Nosy @terryjreedy, @Carreau

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-05-16.00:58:58.805>
created_at = <Date 2020-05-11.03:56:20.139>
labels = ['interpreter-core', '3.9']
title = '[regression] inspect.getdoc not returning docstring.'
updated_at = <Date 2020-05-16.00:58:58.804>
user = 'https://github.com/Carreau'

bugs.python.org fields:

activity = <Date 2020-05-16.00:58:58.804>
actor = 'terry.reedy'
assignee = 'none'
closed = True
closed_date = <Date 2020-05-16.00:58:58.805>
closer = 'terry.reedy'
components = ['Interpreter Core']
creation = <Date 2020-05-11.03:56:20.139>
creator = 'mbussonn'
dependencies = []
files = []
hgrepos = []
issue_num = 40587
keywords = []
message_count = 3.0
messages = ['368603', '368605', '368992']
nosy_count = 2.0
nosy_names = ['terry.reedy', 'mbussonn']
pr_nums = []
priority = 'normal'
resolution = 'duplicate'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue40587'
versions = ['Python 3.9']

Activity

  1. Carreau commented on May 11, 2020

    Carreaumannequin
    MannequinAuthor

    In python 3.8:

    >>> class A(object):
    ...     """standard docstring"""
    ...     pass
    ...
    >>> import inspect
    >>> inspect.getdoc(A())
    'standard docstring'
    

    In 3.9:

    $ python
    Python 3.9.0a6+ (heads/master:5b956ca42d, May 10 2020, 20:31:26)
    [Clang 9.0.0 (clang-900.0.39.2)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> class A(object):
    KeyboardInterrupt
    >>> class A(object):
    ...     """standard docstring"""
    ...     pass
    ...
    >>> import inspect
    >>> inspect.getdoc(A())
    >>>
    
  2. added
    interpreter-core
    3.9 (EOL)
    on May 11, 2020
  3. Carreau commented on May 11, 2020

    Carreaumannequin
    MannequinAuthor

    That will break a lot o the interactive usage for the scientific ecossytem Imho,

    For example anyone that get a Pandas Dataframe and try to get help on it either via help(df), or df? in IPython/Jupyter.

    Might be purposeful (https://bugs.python.org/issue40257)

  4. terryjreedy commented on May 16, 2020

    @terryjreedy
    Member

    This change was part of bpo-40257 and is being discussed there (where I suggested reverting it).

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.9 (EOL)interpreter-core

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions