-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC:GH34026 #34059
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
DOC:GH34026 #34059
Changes from 4 commits
f52f53f
d274a76
8a6d8aa
b8df42c
79b08bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2977,7 +2977,7 @@ def encode(self, encoding, errors="strict"): | |
_shared_docs[ | ||
"str_strip" | ||
] = r""" | ||
Remove leading and trailing characters. | ||
Remove %(position)s characters. | ||
|
||
Strip whitespaces (including newlines) or a set of specified characters | ||
from each string in the Series/Index from %(side)s. | ||
|
@@ -3040,20 +3040,27 @@ def encode(self, encoding, errors="strict"): | |
""" | ||
|
||
@Appender( | ||
_shared_docs["str_strip"] % dict(side="left and right sides", method="strip") | ||
_shared_docs["str_strip"] | ||
% dict(side="left and right sides", method="strip", position=None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't % dict(side="left and right sides", method="strip", position="leading and trailing") ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh hell. Yes, it should have both leading and trailing. Fixing now and will push. Thank you. |
||
) | ||
@forbid_nonstring_types(["bytes"]) | ||
def strip(self, to_strip=None): | ||
result = str_strip(self._parent, to_strip, side="both") | ||
return self._wrap_result(result) | ||
|
||
@Appender(_shared_docs["str_strip"] % dict(side="left side", method="lstrip")) | ||
@Appender( | ||
_shared_docs["str_strip"] | ||
% dict(side="left side", method="lstrip", position="leading") | ||
) | ||
@forbid_nonstring_types(["bytes"]) | ||
def lstrip(self, to_strip=None): | ||
result = str_strip(self._parent, to_strip, side="left") | ||
return self._wrap_result(result) | ||
|
||
@Appender(_shared_docs["str_strip"] % dict(side="right side", method="rstrip")) | ||
@Appender( | ||
_shared_docs["str_strip"] | ||
% dict(side="right side", method="rstrip", position="trailing") | ||
) | ||
@forbid_nonstring_types(["bytes"]) | ||
def rstrip(self, to_strip=None): | ||
result = str_strip(self._parent, to_strip, side="right") | ||
|
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 might be simpler to add a substitution here, something like
and then, at the top of the def of
lstrip
, insidedict
, addposition="leading"
(and similarly "trailing" forrstrip
)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.
Gotcha, I see. Ok, I'll fix those then commit again. ty!