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

what is s_hist #811

Closed
thomasballinger opened this issue Jun 19, 2020 · 10 comments
Closed

what is s_hist #811

thomasballinger opened this issue Jun 19, 2020 · 10 comments
Labels
Milestone

Comments

@thomasballinger
Copy link
Member

@thomasballinger thomasballinger commented Jun 19, 2020

repl.py's Repl class has an s_hist attribute that nobody understands.

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Jun 19, 2020

(I might look at this)

@5aumy4
Copy link

@5aumy4 5aumy4 commented Jul 3, 2020

Hey! can I do some help?

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Jul 4, 2020

Sure! @5aumy4 this task is to figure out what the s_hist attribute of the Repl class does, and to either add a comment saying what it does or to remove it. Here's where it's defined in the Repl class:

self.s_hist = []

and here's where it's defined in the URWIDRepl class:
self.s_hist = []

@5aumy4
Copy link

@5aumy4 5aumy4 commented Jul 4, 2020

Alright!

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Jul 13, 2020

@5aumy4 any research findings on this?

@5aumy4
Copy link

@5aumy4 5aumy4 commented Jul 13, 2020

Hey @thomasballinger ,
I researched a bit for the problem and then found out that bpython doesn't works for windows, I also tried to install linux on my laptop but I have encountered a few issues in doing so.
So it seems I can't work well on the problem.
And I discovered this a pretty long time ago, just that I forgot to inform you about this(sorry, my bad)
So I can't work on it :( plus I think the problem is too complex for me as I am a beginner.
I hope you find someone better than me to help you out in this.
:)

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Jul 13, 2020

Thanks for giving it a shot, and I'm sorry bpython didn't work for you on Windows! I've heard good things about Windows Subsystem for Linux and bpython should work there, although there may be a few issues there too.

@rybarczykj
Copy link
Contributor

@rybarczykj rybarczykj commented Aug 13, 2020

It looks like s_hist stores formatted inputs and outputs. (formatted as old formatstrings with \x01 \x02 \x03 and \x04)

here's a bpython-curses session:
Screen Shot 2020-08-13 at 1 37 25 PM
and here's the associated s_hist values:
Screen Shot 2020-08-13 at 1 38 25 PM

It's used by redraw() in cli.py to recreate the screen when the window is resized. It doesn't seem to be used at all in urwid.py despite being appended to in a few spots throughout.

Side note: Maybe the s in s_hist refers to the variable self.s, which seems to be cli.py's not-very-well-named equivalent of self.current_line in repl.py.

@rybarczykj
Copy link
Contributor

@rybarczykj rybarczykj commented Aug 13, 2020

I'll make a PR to add a comment or two and remove it in those unused places. Maybe also rename it.

@rybarczykj
Copy link
Contributor

@rybarczykj rybarczykj commented Aug 20, 2020

Resolved with PR #842!

@sebastinas sebastinas closed this Aug 24, 2020
@sebastinas sebastinas added the refactor label Aug 24, 2020
@sebastinas sebastinas added this to the release-0.20 milestone Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.