Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated inspect functions #89483

Closed
hugovk opened this issue Sep 29, 2021 · 6 comments
Closed

Remove deprecated inspect functions #89483

hugovk opened this issue Sep 29, 2021 · 6 comments
Labels
3.11 stdlib Python modules in the Lib dir

Comments

@hugovk
Copy link
Member

hugovk commented Sep 29, 2021

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']

    @hugovk
    Copy link
    Member Author

    hugovk commented Sep 29, 2021

    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.

    @hugovk hugovk added 3.11 stdlib Python modules in the Lib dir labels Sep 29, 2021
    @ambv
    Copy link
    Contributor

    ambv commented Sep 29, 2021

    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.

    @tirkarthi
    Copy link
    Member

    tirkarthi commented Sep 29, 2021

    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

    @hugovk
    Copy link
    Member Author

    hugovk commented Sep 29, 2021

    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)

    @ambv
    Copy link
    Contributor

    ambv commented Oct 20, 2021

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

    @ambv
    Copy link
    Contributor

    ambv commented Oct 20, 2021

    Thanks, Hugo! 🍰

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants