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

Non-required hasattr checks in test_typing #90595

Closed
sobolevn opened this issue Jan 19, 2022 · 4 comments
Closed

Non-required hasattr checks in test_typing #90595

sobolevn opened this issue Jan 19, 2022 · 4 comments
Labels
3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

BPO 46437
Nosy @gvanrossum, @miss-islington, @sobolevn, @Fidget-Spinner
PRs
  • bpo-46437: remove useless hasattr from test_typing #30704
  • [3.10] bpo-46437: remove useless hasattr from test_typing (GH-30704) #30713
  • [3.9] bpo-46437: remove useless hasattr from test_typing (GH-30704) #30714
  • 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 2022-01-20.08:59:44.697>
    created_at = <Date 2022-01-19.17:42:38.412>
    labels = ['type-bug', 'tests', '3.11']
    title = 'Non-required `hasattr` checks in `test_typing`'
    updated_at = <Date 2022-01-20.08:59:44.697>
    user = 'https://github.com/sobolevn'

    bugs.python.org fields:

    activity = <Date 2022-01-20.08:59:44.697>
    actor = 'AlexWaygood'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-01-20.08:59:44.697>
    closer = 'AlexWaygood'
    components = ['Tests']
    creation = <Date 2022-01-19.17:42:38.412>
    creator = 'sobolevn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46437
    keywords = ['patch']
    message_count = 4.0
    messages = ['410974', '410985', '410986', '410987']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'miss-islington', 'sobolevn', 'kj']
    pr_nums = ['30704', '30713', '30714']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46437'
    versions = ['Python 3.11']

    @sobolevn
    Copy link
    Member Author

    There are several legacy hasattr checks that are always True in newer Python versions:

    1. if hasattr(typing, 'Collection'):
    2. if hasattr(contextlib, 'AbstractContextManager'):

    I think it is safe to delete them.

    @sobolevn sobolevn added 3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 19, 2022
    @gvanrossum
    Copy link
    Member

    New changeset 263c0dd by Nikita Sobolev in branch 'main':
    bpo-46437: remove useless hasattr from test_typing (bpo-30704)
    263c0dd

    @miss-islington
    Copy link
    Contributor

    New changeset 3b51926 by Miss Islington (bot) in branch '3.9':
    bpo-46437: remove useless hasattr from test_typing (GH-30704)
    3b51926

    @miss-islington
    Copy link
    Contributor

    New changeset 07b12fd by Miss Islington (bot) in branch '3.10':
    bpo-46437: remove useless hasattr from test_typing (GH-30704)
    07b12fd

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants