[Python-ideas] New explicit methods to trim strings

Jonathan Fine jfine2358 at gmail.com
Mon Mar 25 10:41:59 EDT 2019


Rhodri James wrote:

> They really don't.  Negative numbers are well defined in terms of being
> the additive inverse of natural numbers.  String concatenation doesn't
> have a well-defined inverse,
>

In an earlier post I showed (assuming some knowledge of group theory) that
for strings in the two letters 'a' and 'b', allowing negative strings give
rise to what mathematicians call the free group on 2 letters, which is an
enormous object. If you want the math, look at
https://en.wikipedia.org/wiki/Free_group#Construction [Except previously I
linked to the wrong part of the page.]

Free groups are a difficult concept, usually introduced at post-graduate
level. If you can tell me you understand that concept, I'm happy on that
basis to explain how it provides string concatenation with a well-defined
inverse.

-- 
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190325/c2c09343/attachment-0001.html>


More information about the Python-ideas mailing list