Skip to content

zip() function example in tutorial #47772

Closed

Description

@jsizelove
mannequin
BPO 3522
Nosy @birkenfeld
Files
  • datastructures.diff
  • 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/birkenfeld'
    closed_at = <Date 2008-08-08.06:44:21.720>
    created_at = <Date 2008-08-08.00:11:52.510>
    labels = ['docs']
    title = 'zip() function example in tutorial'
    updated_at = <Date 2008-08-08.06:44:21.719>
    user = 'https://bugs.python.org/jsizelove'

    bugs.python.org fields:

    activity = <Date 2008-08-08.06:44:21.719>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-08-08.06:44:21.720>
    closer = 'georg.brandl'
    components = ['Documentation']
    creation = <Date 2008-08-08.00:11:52.510>
    creator = 'jsizelove'
    dependencies = []
    files = ['11077']
    hgrepos = []
    issue_num = 3522
    keywords = ['patch']
    message_count = 2.0
    messages = ['70871', '70884']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'jsizelove']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3522'
    versions = ['Python 3.0']

    Activity

    1. jsizelove commented on Aug 8, 2008

      jsizelovemannequin
      MannequinAuthor

      The zip() function is now a generator in Python 3.0. There is an
      example of using the zip() function in the Python 3.0 tutorial,
      http://docs.python.org/dev/3.0/tutorial/datastructures.html.

      When running the example, I got:

      >>> mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
      >>> zip(*mat)
      <zip object at 0x70fc60>

      I wrapped it in a call to list() to get the example output:

      >>> list(zip(*mat))
      [(1, 4, 7), (2, 5, 8), (3, 6, 9)]

      The attached patch file contains this change.

    2. added
      docs
      on Aug 8, 2008
    3. birkenfeld commented on Aug 8, 2008

      @birkenfeld
      Member

      Thanks, applied in r65592.

    4. 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

    Labels

    docs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions