-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add format_as to extract() methods #101
Conversation
Also I've noticed |
Hi @Granitosaurus ! 👋 :) Been thinking about this, I don't like just passing along in this case, though I'm not sure if I can articulate precisely why, but let me try. I'd be in favor of either passing along explicitly an argument that we're interested ( This way, if in the future Parsel gets another backend or something (as suggested in #29), the API will be consistent. Another reason a direct passthrough isn't a good idea is that it would allow to override the values being set by Parsel, which doesn't look that great -- is this needed in some use case? About the Does this make sense? |
Hey Elias, Personally I just want to get So I feel that these two arguments
I feel that together with
Real case:
All in all I feel that one of these things would be a great addition to
|
So maybe it could be a new keyword argument |
Uuu, that's clever! |
I've updated the PR to reflect the discussed change:
However
|
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 248 260 +12
Branches 46 49 +3
=====================================
+ Hits 248 260 +12
Continue to review full report at Codecov.
|
oh yeah, I had forgotten, sorry about that! 😆 how about |
updated the keyword to |
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.
I believe it's now in the right direction, but it needs some tests. :)
method=format_as or self._tostring_method, | ||
encoding='unicode', | ||
with_tail=False, | ||
pretty_print=bool(format_as), |
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.
This doesn't look right, it's using the boolean value of format_as
.
Can you please add tests for the full behavior? :)
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.
@eliasdorneles the logic behind this is that if format_as
is explicitly specified then it should pretty_print as well. Alternatively pretty_print argument should be added separately I guess
Hey @Granitosaurus - this is a neat little feature! Are you still interested in implementing it? If not, perhaps we can still use your commits as part of an implementation? |
Hey @cathalgarvey, |
Sorry for the long time to re-review! @kmike how do you feel about this one? Usage will look like |
Hey! I'm not sure I understand it properly - how should user decide between |
It's been a long time since the last comment! |
@Granitosaurus Any thoughts? I see there’s been quite some back and forward. |
No description provided.