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

itertools.islice not accepting np.int64 #75280

Closed
braaannigan mannequin opened this issue Aug 1, 2017 · 6 comments
Closed

itertools.islice not accepting np.int64 #75280

braaannigan mannequin opened this issue Aug 1, 2017 · 6 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@braaannigan
Copy link
Mannequin

braaannigan mannequin commented Aug 1, 2017

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

    @braaannigan
    Copy link
    Mannequin Author

    braaannigan mannequin commented Aug 1, 2017

    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)

    @braaannigan braaannigan mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels Aug 1, 2017
    @rhettinger
    Copy link
    Contributor

    @braaannigan
    Copy link
    Mannequin Author

    braaannigan mannequin commented Aug 1, 2017

    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.

    @mdickinson
    Copy link
    Member

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

    @braaannigan
    Copy link
    Mannequin Author

    braaannigan mannequin commented Aug 1, 2017

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

    Liam

    @terryjreedy terryjreedy added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Aug 5, 2017
    @terryjreedy
    Copy link
    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

    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants