Skip to content

ENH: add last element to repring of sequences #3941

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

Closed
wants to merge 2 commits into from
Closed

ENH: add last element to repring of sequences #3941

wants to merge 2 commits into from

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jun 18, 2013

No description provided.

@ghost ghost assigned cpcloud Jun 18, 2013
@cpcloud
Copy link
Member Author

cpcloud commented Jun 18, 2013

the mutual recursion should bottom out in _pprint_seq during either the call to next (will raise StopIteration) or it will raise StopIteration when i not in range(min(nitems, len(seq))). i will also change that to xrange because that will be a memory hog for large sequences with the default option. in any case i will write more tests and i still need to fix the unicode literal repring

@cpcloud
Copy link
Member Author

cpcloud commented Jun 18, 2013

should i be using pprint_thing anytime (even a trivial string) i'm formatting a string?

@ghost
Copy link

ghost commented Jun 18, 2013

pprint_thing is actually all about doing unicode properly. whenever you have something
that goes to the console, it's best to use pprint_thing. using it also makes sure
things are kept as unicode until it's time to encode them into a specific encoding.

@cpcloud
Copy link
Member Author

cpcloud commented Jun 18, 2013

well that's just dandy! thanks

@cpcloud
Copy link
Member Author

cpcloud commented Jun 19, 2013

@y-p @jreback u ok with this?

@jreback
Copy link
Contributor

jreback commented Jun 19, 2013

what does this fix?

@cpcloud
Copy link
Member Author

cpcloud commented Jun 19, 2013

just tacks on the last element of a sequence when the user has set max_seq_items to something > 0

@jreback
Copy link
Contributor

jreback commented Jun 19, 2013

ok as long as @y-p ok

@ghost
Copy link

ghost commented Jun 19, 2013

related #3456, #3391 and especially #3426,
would have preferred matching behaviour to numpy: [Foo_N ... Foo_N]

@cpcloud
Copy link
Member Author

cpcloud commented Jun 19, 2013

I can do that. No problem.

@cpcloud
Copy link
Member Author

cpcloud commented Jun 19, 2013

@y-p N is the display.max_seq_items option value? should it be N / 2?

@ghost
Copy link

ghost commented Jun 20, 2013

no preference, if possible align with numpy, I believe it has an equiv in set_printoptions.

@cpcloud
Copy link
Member Author

cpcloud commented Jun 20, 2013

closing in favor of #3974.

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

Successfully merging this pull request may close these issues.

2 participants