<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 2 Apr 2019, at 13:23, Paul Moore <<a href="mailto:p.f.moore@gmail.com" class="">p.f.moore@gmail.com</a>> wrote:</div><div class=""><div class=""><br class="">It would be really helpful if someone could go through the various use<br class="">cases presented in this thread and classify them - filename<br class="">manipulation, natural language uses, and "other". We could then focus<br class="">on the "other" category to get a better feel for what use cases might<br class="">act as a good argument for the feature. To me, it's starting to feel<br class="">like a proposal that looks deceptively valuable because it's a<br class="">"natural", or "obvious", addition to make, and there's a weight of<br class="">people thinking of cases where they "might find it useful", but the<br class="">reality is that many of those cases are not actually as good a fit for<br class="">the feature as it seems at first glance. It would help the people in<br class="">favour of the proposal to make their case if they could dispel that<br class="">impression by giving a clearer summary of the expected use cases...<br class=""></div></div></blockquote></div><br class=""><div class=""><br class=""></div><div class=""><br class="">I found two instances of strip_prefix in the code base I work on: stripping "origin/" from git branch names, and "Author:" to get the author from log output, again from git. </div><div class=""><br class=""></div><div class="">A good place to look for examples is this: <a href="https://github.com/search?utf8=%E2%9C%93&q=%22strip_prefix(%22+extension:py+language:Python+language:Python&type=Code&ref=advsearch&l=Python&l=Python" class="">https://github.com/search?utf8=✓&q=%22strip_prefix%28%22+extension%3Apy+language%3APython+language%3APython&type=Code&ref=advsearch&l=Python&l=Python</a>  A pattern that one sees quickly is that there are lots and lots of functions that strip a specific and hardcoded prefix. There's a lot of path manipulation too. And of course, there's an enormous amount of copy paste (jsfunctions.py is everywhere!).</div><div class=""><br class=""></div><div class="">Some examples from the search above:</div><div class=""><br class=""></div><div class="">Removing "file:" prefix: <a href="https://github.com/merijn/dotfiles/blob/43c736c73c5eda413dc7b4615bb679bd43a18d1a/dotfiles/hg-data/hooks/bitbucket.py#L16" class="">https://github.com/merijn/dotfiles/blob/43c736c73c5eda413dc7b4615bb679bd43a18d1a/dotfiles/hg-data/hooks/bitbucket.py#L16</a></div><div class=""><br class=""></div><div class="">This is a strange one, which seems to strip different things? <a href="https://github.com/imperodesign/paas-tools/blob/649372762a18acefed0a24a970b93eb494529df9/deis/prd/controller/registry/tests.py#L99" class="">https://github.com/imperodesign/paas-tools/blob/649372762a18acefed0a24a970b93eb494529df9/deis/prd/controller/registry/tests.py#L99</a></div><div class=""><br class=""></div><div class="">Removing "master.": <a href="https://github.com/mithro/chromium-build/blob/98d83e124dc08510756906171922a22ba27b87fa/scripts/tools/dump_master_cfg.py#L67" class="">https://github.com/mithro/chromium-build/blob/98d83e124dc08510756906171922a22ba27b87fa/scripts/tools/dump_master_cfg.py#L67</a></div><div class=""><br class=""></div><div class="">Also not path: <a href="https://github.com/BlissRoms-x86/platform_external_swiftshader/blob/01c0db17f511badb921efc53981849cdacb82793/third_party/subzero/bloat/bloat.py#L212" class="">https://github.com/BlissRoms-x86/platform_external_swiftshader/blob/01c0db17f511badb921efc53981849cdacb82793/third_party/subzero/bloat/bloat.py#L212</a></div><div class=""><br class=""></div><div class="">Removing "Re:" from email subject lines: <a href="https://github.com/emersion/python-emailthreads/blob/0a56af7fd6de16105c27b7c149eeb0282e95e587/emailthreads/util.py#L21" class="">https://github.com/emersion/python-emailthreads/blob/0a56af7fd6de16105c27b7c149eeb0282e95e587/emailthreads/util.py#L21</a></div><div class=""><br class=""></div><div class="">Removing "MAILER_": <a href="https://github.com/vitalk/flask-mailer/blob/c724643f13e51d2e57546164e3e4abf9eb5d8097/flask_mailer/util.py#L30" class="">https://github.com/vitalk/flask-mailer/blob/c724643f13e51d2e57546164e3e4abf9eb5d8097/flask_mailer/util.py#L30</a></div><div class=""><br class=""></div><div class="">I'm giving up now, because I got tired :)</div><div class=""><br class=""></div><div class="">/ Anders</div></body></html>