-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat!: sourcemap
repr, str, docs and fixes
#58
Conversation
def __str__(self) -> str: | ||
return self.__root__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the default __str__
method output if __repr__
is defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't seem like it. I added the test before I added this and it would fail at first and give me this:
SourceMap(__root__"<realsourcemap>")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where realsourcemap
was the real source map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I comment out def __str__
, I get this:
assert "__root__='44...441:16;;;;;;'" == '449:4441:16:...4441:16;;;;;;'
so it is __root__='44...441:16;;;;;;'
.
Does overriding __str__
here cause any issues I am not yet aware of?
This diff will be better once this merges #59 |
sourcemap
repr and str as well as documentation improvementsourcemap
repr, str, docs and fixes
91f7126
to
7fc613e
Compare
Co-authored-by: NotPeopling2day <32708219+NotPeopling2day@users.noreply.github.com>
What I did and How I Did It
My main goal here is trying to understand, so if you review this PR, please make help me do so!
So I noticed that
__repr__
forSourceMap
looked funny, so I starting poking in that. I foundSourceMapItem
and theparse()
method so wanted to know more about how that worked because the docs were sort of missing.__repr__
implementation toSourceMap
__str__
implementation toSourceMap
SourceMapItem
stop
tolength
inSourceMapItem
fixes: APE-581
How to verify it
Checklist