10000 Optimization: delay computing len of numeric_range until needed · Issue #673 · more-itertools/more-itertools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Optimization: delay computing len of numeric_range until needed #673
Closed
@eltoder

Description

@eltoder

Instead of always computing _len in __init__, we can delay the computation until it is used. For simple iteration over the range, we can avoid computing it entirely. For other uses it will add negligible overhead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredWe're not inclined to fix this issue, but please link to it if the same thing comes up later

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0