Skip to content

itertools.islice not accepting np.int64 #75280

Closed

Description

@braaannigan
BPO 31097
Nosy @rhettinger, @terryjreedy, @mdickinson, @braaannigan
Superseder
  • bpo-30537: Using PyNumber_AsSsize_t in itertools.islice
  • 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 2017-08-05.03:02:31.085>
    created_at = <Date 2017-08-01.13:23:06.701>
    labels = ['type-bug', 'library']
    title = 'itertools.islice not accepting np.int64'
    updated_at = <Date 2017-08-05.03:07:56.748>
    user = 'https://github.com/braaannigan'

    bugs.python.org fields:

    activity = <Date 2017-08-05.03:07:56.748>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-08-05.03:02:31.085>
    closer = 'terry.reedy'
    components = ['Library (Lib)']
    creation = <Date 2017-08-01.13:23:06.701>
    creator = 'braaannigan'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31097
    keywords = []
    message_count = 6.0
    messages = ['299617', '299618', '299620', '299625', '299628', '299769']
    nosy_count = 4.0
    nosy_names = ['rhettinger', 'terry.reedy', 'mark.dickinson', 'braaannigan']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '30537'
    type = 'behavior'
    url = 'https://bugs.python.org/issue31097'
    versions = ['Python 3.6']

    Activity

    1. braaannigan commented on Aug 1, 2017

      braaanniganmannequin
      MannequinAuthor

      The error arises when this code is used:
      itertools.islice( [3, 4, 5], np.int64(2) )

      but not with this
      itertools.islice([3,4,5], 2)

    2. added
      type-crashA hard crash of the interpreter, possibly with a core dump
      stdlibStandard Library Python modules in the Lib/ directory
      on Aug 1, 2017
    3. rhettinger commented on Aug 1, 2017

      @rhettinger
      Contributor
    4. braaannigan commented on Aug 1, 2017

      braaanniganmannequin
      MannequinAuthor

      Thanks Ray. The use case is here:
      https://stackoverflow.com/questions/45356718/saving-matplotlib-animation-leads-to-error/45438057#45438057

      I'm going to suggest a workaround in matplotlib for the moment. Changing type in this use case shouldn't be a big issue, it only happens once for each animation created.

    5. mdickinson commented on Aug 1, 2017

      @mdickinson
      Member

      That actually looks as though it may be worth a bug report to the matplotlib folks.

    6. braaannigan commented on Aug 1, 2017

      braaanniganmannequin
      MannequinAuthor

      Hi Mark - I've done that here:
      matplotlib/matplotlib#8973

      Liam

    7. added
      type-bugAn unexpected behavior, bug, or error
      and removed
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Aug 5, 2017
    8. terryjreedy commented on Aug 5, 2017

      @terryjreedy
      Member

      LB, an exception is a graceful shutdown, not a crash. A crash is a seg fault, core dump, or an OS message 'Your app has stopped unexpectedly'.

      In bpo-30537, the exception was regarded as expected, not a bug, and changing islice to accept np ints was regarded as an enhancement, and therefore limited to 3.7

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

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions