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

printing file is wrong #31

Closed
Jaymon opened this issue Aug 23, 2018 · 1 comment
Closed

printing file is wrong #31

Jaymon opened this issue Aug 23, 2018 · 1 comment

Comments

@Jaymon
Copy link
Owner

Jaymon commented Aug 23, 2018

# file1.py

from file2 import String

s = String("foo")
pout.v(s)
# file2.py

class String(str):
    def __str__(self):
        pout.h()
        return self

when you run file1.py it will print:

here 6 (file1.py:6)

instead of:

here 5 (file2.py:5)
@Jaymon
Copy link
Owner Author

Jaymon commented Dec 24, 2018

This issue was interesting, what the entry frame detector was doing was trying to find the last time the pout/__init__.py file was called in the frame stack, well, this series of events had an interesting frame stack because:

  1. pout.v(s) was called
  2. While in the pout.v(s) call, when pout was getting the string representation of s then pout.h() was called
  3. The frame stack then had two chains of pout/__init__.py calls broken up with calls to file1.py and file2.py but the frame finder always went until it found the last pout/__init__.py call, which was pout.v(s)

Jaymon added a commit that referenced this issue Dec 27, 2018
…d the main part of the fix back to original and I'm considering marking #31 wontfix because I can't think of a fix that works for both short of passing in the framestack (which I think would work since I wouldn't have to autodiscover anymore)
Jaymon added a commit that referenced this issue Dec 27, 2018
…ace commit as discussed in issue #36. I think this also addresses #31, which I was having problems fixing because my fix was not only 3x slower but broke the previous extending capability. I think this addresses both those issues now and the code is much cleaner. Tests are not passing yet and the code needs to be cleaned up since there is a lot of dead and commented out code and tests.
@Jaymon Jaymon closed this as completed in aa8f34d Dec 27, 2018
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

No branches or pull requests

1 participant