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

__len__ method for sage.misc.lazy_list #16118

Closed
MatthieuDien opened this issue Apr 10, 2014 · 9 comments
Closed

__len__ method for sage.misc.lazy_list #16118

MatthieuDien opened this issue Apr 10, 2014 · 9 comments

Comments

@MatthieuDien
Copy link

Currently, the only way to obtain the cache's length of a lazy_list is to call info method which print on the standard output :

sage: from sage.misc.lazy_list import lazy_list
sage: l = lazy_list(NN)
sage: l[42]
sage: l.info()
cache length 43
start        0
stop         2147483647
step         1

The goal of this ticket is to provide a __len__ method to obtain this length :

sage: from sage.misc.lazy_list import lazy_list
sage: l = lazy_list(NN)
sage: len(l)
0
sage: l[42]
42
sage: len(l)
43
sage: l[36]
36
sage: len(l)
43

Component: misc

Keywords: days57

Branch/Commit: u/MatthieuDien/__len___method_for_sage_misc_lazy_list @ ed1b53a

Reviewer: Marc Mezzarobba

Issue created by migration from https://trac.sagemath.org/ticket/16118

@MatthieuDien MatthieuDien added this to the sage-6.2 milestone Apr 10, 2014
@MatthieuDien
Copy link
Author

Changed keywords from none to days57

@MatthieuDien

This comment has been minimized.

@MatthieuDien

This comment has been minimized.

@MatthieuDien
Copy link
Author

@MatthieuDien
Copy link
Author

Commit: ed1b53a

@MatthieuDien
Copy link
Author

New commits:

ed1b53aadd `__len__` method for lazy_list

@MatthieuDien
Copy link
Author

comment:6

After some discussions, this ticket need to be closed
See #16137

@MatthieuDien MatthieuDien removed this from the sage-6.2 milestone Apr 12, 2014
@vbraun
Copy link
Member

vbraun commented Apr 13, 2014

comment:9

author/reviewer names

@mezzarobba
Copy link
Member

Reviewer: Marc Mezzarobba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants