<div dir="ltr">Here, concisely, is my view of the situation and my preferences. Mostly, I won't give supporting arguments or evidence.<div><br></div><div>We can TRUNCATE either PRE or the POST, and similarly SUBTRACT.</div><div><br></div><div>SUBTRACT can raise a ValueError.</div><div>TRUNCATE always returns a value.</div><div><br></div><div>Interactive examples (not tested)</div><div>    >>> from somewhere import post_subtract</div><div>    >>> sub_ed = post_subtract('ed')</div><div>    >>> sub_ed('fred')</div><div>    >>> 'fr'</div><div>    >>> sub_ed('lead')</div><div>    ValueError</div><div><br></div><div>Similarly</div><div><div>    >>> trunc_ed('fred')</div><div>    'fr'</div><div>    >>> trunc_ed('lead')</div><div>    'lead'</div></div><div><br></div><div>Can be 'combined into one'</div><div>   >>> pre_truncate('app')('applet)</div><div>   'let'</div><div>    >>> pre_truncate('app')('paper')</div><div>    'paper'</div><div><br></div><div>Possibly</div><div>1.  Allow pre_truncate('app', 'applet'), perhaps with different spelling.</div><div>2. Allow '-' as a symbol for subtract. (Likely to be controversial.)</div><div><br></div><div>I'm not particularly attached to the names. But I definitely think</div><div>3. None of these are string methods. (So pure Python implementation automatically backports.)</div><div>4. Encourage a 'two-step' process. This allow separation of concerns, and encourage good names.</div><div><br></div><div>Supporting argument.</div><div>When we write</div><div>    pre_subtract(suffix, s)</div><div>the suffix has a special meaning. For example, it's the header. So in one module define and test a routine remove_header. And in another module use remove_header. That way, the user of remove_header only needs to know the business purpose of the command. And the implementer needs to know only the value of the header.</div><div><br></div><div>If the specs change, and the implementer needs to use regular expressions, then this does not affect the user of remove_header.</div><div><br></div><div>I hope this helps. Maybe others would like to express their preferences.</div><div><br></div><div>-- </div><div>Jonathan</div><div><br></div><div>-- </div><div>Jonathan</div><div>   </div><div><br></div><div><br></div><div><br></div><div><br></div></div>