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

unbound the lazy_list formatter #21200

Closed
dkrenn opened this issue Aug 10, 2016 · 24 comments
Closed

unbound the lazy_list formatter #21200

dkrenn opened this issue Aug 10, 2016 · 24 comments

Comments

@dkrenn
Copy link
Contributor

dkrenn commented Aug 10, 2016

In #21164, a string formatter for lazy lists was introduced in the class lazy_list_generic. The aim of this ticket is to unbound this method, so that one is able to use it outside lazy lists as well.

Depends on #21164

Component: misc

Author: Daniel Krenn

Branch/Commit: a8a006a

Reviewer: Clemens Heuberger

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

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

Dependencies: #21164

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

comment:1

This will become handy when using it in conjunction with k-regular sequences (no ticket yet) and probably other sequences as well.

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

Branch: u/dkrenn/lazy_list-unbound-formatter

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

Last 10 new commits:

bc1bd71Trac #21164, comment 8, 1: make update_cache_up_to private (i.e., prepend a _)
608332fTrac #21164, comment 8, 2: revert rewrite in get (variable n vs. i)
ef28cceTrac #21164, comment 11, 3: revert rewrite in __add__
7675c49Trac #21164, comment 11, 2: refine docstring to make idempotence of lazy_list visible
37c8fadTrac #21164, comment 11, 4: better description of arguments in str
9ba1dcfTrac #21164, comment 11, 1: extend docstring explaining inheriting
4ba5bd6Trac #21200: move code (no other changes)
48d82deTrac #21200: modify code so that everything works again
e3455baTrac #21200: fix doctests
9dc6624Trac #21200: polish docstrings

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

Commit: 9dc6624

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

Author: Daniel Krenn

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 10, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

a46ba93Trac #21200: rephrase requirements for input

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 10, 2016

Changed commit from 9dc6624 to a46ba93

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 10, 2016

comment:7

Replying to @dkrenn:

This will become handy when using it in conjunction with k-regular sequences (no ticket yet) and probably other sequences as well.

Meanwhile there is a ticket, namely #21202.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 11, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

d3e2df6Trac #21200: simplify requirements for input (only iterable needed)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 11, 2016

Changed commit from a46ba93 to d3e2df6

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 11, 2016

comment:9

Simplifed the requirements needed for the input. (Now L needs only to be iterable.)

@videlec
Copy link
Contributor

videlec commented Aug 12, 2016

comment:10

Instead of '{!r}'.format(e) you could use the more direct repr(e).

@videlec
Copy link
Contributor

videlec commented Aug 12, 2016

comment:11

Why don't you encode the default argument in the function

def lazy_list_formatter(L, name='lazy list', separator=', ', more='...',
        opening_delimiter='[', closing_delimiter=']',
        preview=3):

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 16, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

18e1348Trac #21164: 64bit vs 32bite
90ffe8cMerge branch 'u/dkrenn/lazy_list-various' into u/dkrenn/lazy_list-unbound-formatter
973e74cTrac #21200: simplify formatting
f6a1967Trac #21200: simplify default argument processing

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 16, 2016

Changed commit from d3e2df6 to f6a1967

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 16, 2016

comment:13

Replying to @videlec:

Instead of '{!r}'.format(e) you could use the more direct repr(e).

Indeed. Changed.

@dkrenn
Copy link
Contributor Author

dkrenn commented Aug 16, 2016

comment:14

Replying to @videlec:

Why don't you encode the default argument in the function

def lazy_list_formatter(L, name='lazy list', separator=', ', more='...',
        opening_delimiter='[', closing_delimiter=']',
        preview=3):

I see that this change makes the code much clearer; thus changed.

@cheuberg
Copy link
Contributor

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 12, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

a8a006aTrac #21200: remove period in INPUT section

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 12, 2017

Changed commit from f6a1967 to a8a006a

@cheuberg
Copy link
Contributor

Reviewer: Clemens Heuberger

@cheuberg
Copy link
Contributor

comment:17

@videlec: It seems that you reviewed the code some months ago and that your comments have been taken into account. Feel free to add your name to the Reviewers field.

@vbraun
Copy link
Member

vbraun commented Jan 18, 2017

Changed branch from u/cheuberg/lazy_list-unbound-formatter to a8a006a

@vbraun vbraun closed this as completed in c9a9c20 Jan 18, 2017
dkrenn added a commit to dkrenn/sage that referenced this issue May 25, 2023
…-regular-guess

* u/dkrenn/sequences/k-regular:
  rename to kRegularSequenceSpace
  modify docstring at top of file
  write the missing docstrings
  use lazy_list_formatter in _repr_
  phrase error message and test it
  docstring of _product_of_matrices_
  make product_of_matrices a private method
  Trac sagemath#21200: rephrase requirements for input
  Trac sagemath#21200: polish docstrings
  Trac sagemath#21200: fix doctests
  Trac sagemath#21200: modify code so that everything works again
  Trac sagemath#21200: move code (no other changes)
  add k_regular_sequence to documentation
  lazy import kRegularSequences into global namespace
  fix doctests
  Trac sagemath#21164, comment 11, 1: extend docstring explaining inheriting
  Trac sagemath#21164, comment 11, 4: better description of arguments in str
  Trac sagemath#21164, comment 11, 2: refine docstring to make idempotence of lazy_list visible
  Trac sagemath#21164, comment 11, 3: revert rewrite in __add__
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

5 participants