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

Provide a strict form of zip (PEP-618) requiring same length inputs #84816

Closed
gpshead opened this issue May 15, 2020 · 13 comments
Closed

Provide a strict form of zip (PEP-618) requiring same length inputs #84816

gpshead opened this issue May 15, 2020 · 13 comments
Assignees
Labels
3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@gpshead
Copy link
Member

gpshead commented May 15, 2020

BPO 40636
Nosy @gvanrossum, @gpshead, @pitrou, @cool-RR, @serhiy-storchaka, @miss-islington, @brandtbucher
PRs
  • bpo-40636: Clarify the zip built-in docstring. #20118
  • [3.8] bpo-40636: Clarify the zip built-in docstring. (GH-20118) #20124
  • bpo-40636: PEP 618 implementation #20921
  • bpo-40636: Documentation for zip-strict #20961
  • bpo-40636: Remove overly-strict zip pickling tests #24109
  • 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 = 'https://github.com/brandtbucher'
    closed_at = <Date 2020-06-24.17:15:46.811>
    created_at = <Date 2020-05-15.19:25:39.377>
    labels = ['interpreter-core', 'type-feature', '3.10']
    title = 'Provide a strict form of zip (PEP-618) requiring same length inputs'
    updated_at = <Date 2021-01-05.07:05:37.565>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2021-01-05.07:05:37.565>
    actor = 'brandtbucher'
    assignee = 'brandtbucher'
    closed = True
    closed_date = <Date 2020-06-24.17:15:46.811>
    closer = 'brandtbucher'
    components = ['Interpreter Core']
    creation = <Date 2020-05-15.19:25:39.377>
    creator = 'gregory.p.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40636
    keywords = ['patch']
    message_count = 13.0
    messages = ['368965', '368977', '368980', '371870', '371899', '372272', '372300', '384239', '384243', '384310', '384338', '384339', '384370']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'gregory.p.smith', 'pitrou', 'SilentGhost', 'cool-RR', 'serhiy.storchaka', 'miss-islington', 'brandtbucher']
    pr_nums = ['20118', '20124', '20921', '20961', '24109']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40636'
    versions = ['Python 3.10']

    @gpshead
    Copy link
    Member Author

    gpshead commented May 15, 2020

    PEP-618 https://www.python.org/dev/peps/pep-0618 discussions are still on going. This issue is being filed to track an implementation, assuming the PEP is accepted and one is decided upon.

    I'm filing it now, as I can at least use the issue for documentation enhancements of the existing zip() behavior.

    @gpshead gpshead added 3.9 only security fixes type-feature A feature request or enhancement labels May 15, 2020
    @gpshead
    Copy link
    Member Author

    gpshead commented May 15, 2020

    New changeset 6a5d3ff by Gregory P. Smith in branch 'master':
    bpo-40636: Clarify the zip built-in docstring. (GH-20118)
    6a5d3ff

    @miss-islington
    Copy link
    Contributor

    New changeset c3d025a by Miss Islington (bot) in branch '3.8':
    bpo-40636: Clarify the zip built-in docstring. (GH-20118)
    c3d025a

    @brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.10 only security fixes and removed 3.9 only security fixes labels Jun 17, 2020
    @brandtbucher brandtbucher self-assigned this Jun 17, 2020
    @brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.10 only security fixes and removed 3.9 only security fixes labels Jun 17, 2020
    @brandtbucher brandtbucher self-assigned this Jun 17, 2020
    @vstinner
    Copy link
    Member

    New changeset 310f6aa by Guido van Rossum in branch 'master':
    bpo-40636: PEP-618: add strict parameter to zip() (GH-20921)
    310f6aa

    @gvanrossum
    Copy link
    Member

    New changeset 59cf853 by Ram Rachum in branch 'master':
    bpo-40636: Documentation for zip-strict (bpo-20961)
    59cf853

    @SilentGhost
    Copy link
    Mannequin

    SilentGhost mannequin commented Jun 24, 2020

    Ram, please fix the typo pointed out on github 59cf853#r40044022

    @cool-RR
    Copy link
    Mannequin

    cool-RR mannequin commented Jun 25, 2020

    I'll fix that typo.

    @serhiy-storchaka
    Copy link
    Member

    Tests test_zip_pickle_stability and test_zip_pickle_strict_stability look excessively strict. Why did we need them if there are other pickle tests? They prevent implementing optimizations like in bpo-36694.

    @gvanrossum
    Copy link
    Member

    That's fair. How do other builtins validate their pickling implementation?

    Since the pickling goes through __reduce__/reduce_ex we could instead test that those methods return the expected results, that pickling roundtrips, and that unpickling those exact byte strings produces the expected value?

    @serhiy-storchaka
    Copy link
    Member

    For other types we do not have such strict tests. We just test that pickling roundtrips (it is already tested for zip() in other tests). There are few tests that unpickling some exact byte strings produces the expected value, but these tests are in pickletester.py, because they test the unpickling machinery. If unpickling of some type depends on some private constructor (like re._compile), that constructor can be tested separately.

    So I think that these tests can be removed.

    @gvanrossum
    Copy link
    Member

    Sounds good, go for it. I assume @brandtbucher won't mind.

    @brandtbucher
    Copy link
    Member

    Yep, fine by me. I can remove them later today (unless Serhiy beats me to it).

    @brandtbucher
    Copy link
    Member

    New changeset 27f9daf by Brandt Bucher in branch 'master':
    bpo-40636: Remove overly-strict zip pickling tests (GH-24109)
    27f9daf

    @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.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants