Skip to content

Remove deprecated inspect functions #89483

Closed

Description

@hugovk
BPO 45320
Nosy @ambv, @hugovk, @tirkarthi
PRs
  • bpo-45320 Remove deprecated inspect methods #28618
  • bpo-45903: Fix typo in What's New: Signature.from_builtin is removed #29813
  • 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 2021-10-20.18:49:31.612>
    created_at = <Date 2021-09-29.12:22:30.020>
    labels = ['library', '3.11']
    title = 'Remove deprecated inspect functions'
    updated_at = <Date 2021-11-27.08:45:34.764>
    user = 'https://github.com/hugovk'

    bugs.python.org fields:

    activity = <Date 2021-11-27.08:45:34.764>
    actor = 'hugovk'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-20.18:49:31.612>
    closer = 'lukasz.langa'
    components = ['Library (Lib)']
    creation = <Date 2021-09-29.12:22:30.020>
    creator = 'hugovk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45320
    keywords = ['patch']
    message_count = 6.0
    messages = ['402860', '402877', '402890', '402906', '404515', '404516']
    nosy_count = 3.0
    nosy_names = ['lukasz.langa', 'hugovk', 'xtreak']
    pr_nums = ['28618', '29813']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45320'
    versions = ['Python 3.11']

    Activity

    1. hugovk commented on Sep 29, 2021

      @hugovk
      MemberAuthor

      inspect.getargspec was deprecated in docs since 3.0 (https://docs.python.org/3.0/library/inspect.html?highlight=getargspec#inspect.getargspec), raising a DeprecationWarning since 3.5 (bpo-20438, 3cfec2e).

      inspect.formatargspec was deprecated in docs since 3.5 (https://docs.python.org/3.5/library/inspect.html?highlight=getargspec#inspect.formatargspec), raising a DeprecationWarning since 3.8 (bpo-33582, 46c5cd0).

      Undocumented inspect.Signature.from_function and inspect.Signature.from_builtin in docs and by raising a DeprecationWarning since 3.5 (bpo-20438, 3cfec2e).

      These can be removed in Python 3.11.

    2. added
      3.11only security fixes
      stdlibStandard Library Python modules in the Lib/ directory
      on Sep 29, 2021
    3. ambv commented on Sep 29, 2021

      @ambv
      Contributor

      Have you done any checks how much external code is using the deprecated callables in the wild? I remember when the 3.5 deprecations started, a lot of libraries started emitting them because they stuck to getargspec which was Python 2 compatible.

    4. tirkarthi commented on Sep 29, 2021

      @tirkarthi
      Member

      Slightly related, inspect.getfullargspec was also deprecated and later undeprecated. Please find the discussion post this message

      https://bugs.python.org/issue36751#msg341128

      https://bugs.python.org/issue37010

    5. hugovk commented on Sep 29, 2021

      @hugovk
      MemberAuthor

      Of the 188 repos I managed to clone of 200 top PyPI packages, looks like these 9 are still calling them:

      botocore
      client_python
      cython
      google-api-python-client
      grpc
      ipython
      pycodestyle
      pyrsistent
      wrapt

      Details at #28618 (comment)

    6. ambv commented on Oct 20, 2021

      @ambv
      Contributor

      New changeset d89fb9a by Hugo van Kemenade in branch 'main':
      bpo-45320: Remove long-deprecated inspect methods (GH-28618)
      d89fb9a

    7. ambv commented on Oct 20, 2021

      @ambv
      Contributor

      Thanks, Hugo! ✨ 🍰 ✨

    8. transferred this issue fromon Apr 10, 2022
    9. added a commit that references this issue on Sep 26, 2023
    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.11only security fixesstdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions