As proposed on python-ideas, i setup a repo to turn mail threads into
articles.
here is the repo
https://github.com/Abdur-rahmaanJ/py-mailing-list-summary
i included a script to build .md to .html (with syntax highlighting) here
is the index
Just as to your example, you can try `textwrap.dedent`
At 2019-03-26 00:32:26, "Mikhail V" wrote:
>Not a proposal yet, but some thoughts:
>I think it would help in a longer perspective if a user could
>include a directive in the header of the source code file that
>defines indentation
Dan Sommers wrote:
So what it is "hello" - "world"?
If we were to implement the entire group, it would be an element
that can't be written in any simpler form.
We could do that by representing a string as a sequence of
signed substrings, and performing cancellations whereever
possible during
On Mon, 25 Mar 2019 at 17:49, Anders Hovmöller wrote:
>
> > All of this would be well served by a 3rd party library on PyPI. Strings
> > already have plenty of methods (probably too many). Having `stringtools`
> > would be nice to import a bunch of simple functions from.
>
> I respectfully
On Mon, Mar 25, 2019 at 9:33 AM Mikhail V wrote:
> Not a proposal yet, but some thoughts:
> I think it would help in a longer perspective if a user could
> include a directive in the header of the source code file that
> defines indentation character(s) for this source file. So this
> source
On Sun, Mar 24, 2019 at 10:34 AM Jonathan Fine wrote:
> Guido van Rossum wrote:
>
>> I think this belongs in a personal blog, not on python-ideas and
>> definitely not in a PEP.
>>
>
> I don't agree, but I will accept that judgement, as if Guido still had
> BDFL status.
>
To help add more
> All of this would be well served by a 3rd party library on PyPI. Strings
> already have plenty of methods (probably too many). Having `stringtools`
> would be nice to import a bunch of simple functions from.
I respectfully disagree. This isn't javascript where we are OK with millions of
On 3/25/2019 10:55 AM, David Mertz wrote:
All of this would be well served by a 3rd party library on PyPI.
Strings already have plenty of methods (probably too many). Having
`stringtools` would be nice to import a bunch of simple functions from.
I agree.
--
Terry Jan Reedy
On 3/25/2019 6:22 AM, Jonathan Fine wrote:
Instead of naming these operations, we could use '+' and '-', with
semantics:
# Set the values of the variables.
>>> a = 'hello '
>>> b = 'world'
>>> c = 'hello world'
# Some values between the variables.
>>> a + b == c
Not a proposal yet, but some thoughts:
I think it would help in a longer perspective if a user could
include a directive in the header of the source code file that
defines indentation character(s) for this source file. So this
source would be parsed strictly by this char (or sequence).
E.g.:
Hi
I've been active recently in some threads, that have become a bit heated.
To help things cool down, I won't be posting for a while. I don't know how
long, but certainly not until Wednesday 3 April.
You can of course contact me off-list if you want.
--
Jonathan
All of this would be well served by a 3rd party library on PyPI. Strings
already have plenty of methods (probably too many). Having `stringtools`
would be nice to import a bunch of simple functions from.
On Mon, Mar 25, 2019 at 10:45 AM Alex Grigoryev wrote:
> strip_prefix and strip_suffix I
strip_prefix and strip_suffix I think are the best names from all and work
perfectly with auto completion. Common use case:
" mailto:ma...@gmail.com".strip().strip_prefix("mailto:;)
On Mar 25 2019, at 4:40 pm, Anders Hovmöller wrote:
>
> > Earlier, Anders wrote:
> > I propose naming them
On Mon, Mar 25, 2019 at 7:30 AM Rhodri James wrote:
> On 25/03/2019 12:01, Jonathan Fine wrote:
> > Chris Angelico asked: what does a negative string look like?
> >
> > This is a very good question. It looks a bit like a negative number.
>
> They really don't. Negative numbers are well defined
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
> Earlier, Anders wrote:
> I propose naming them strip_prefix() and strip_suffix() and just skip the one
> that does both sides since it makes no sense to me.
>
> This is good, except I prefer subtract_prefix(a, b), truncate_suffix etc. And
> for the two step process prefix_subtractor(a)(b)
Earlier, Anders wrote:
I propose naming them strip_prefix() and strip_suffix() and just skip the
one that does both sides since it makes no sense to me.
This is good, except I prefer subtract_prefix(a, b), truncate_suffix etc.
And for the two step process prefix_subtractor(a)(b) etc.
--
On 25/03/2019 12:01, Jonathan Fine wrote:
Chris Angelico asked: what does a negative string look like?
This is a very good question. It looks a bit like a negative number.
They really don't. Negative numbers are well defined in terms of being
the additive inverse of natural numbers. String
Here, concisely, is my view of the situation and my preferences. Mostly, I
won't give supporting arguments or evidence.
We can TRUNCATE either PRE or the POST, and similarly SUBTRACT.
SUBTRACT can raise a ValueError.
TRUNCATE always returns a value.
Interactive examples (not tested)
>>>
I think this is a terrible idea. I also think it's a mistake that python uses +
for string concatenation and * for string repeat. You end up with type errors
far from the first place you could have had the crash! That ship has obviously
sailed buy we shouldn't make even more mistakes in the
On 3/25/19 7:01 AM, Jonathan Fine wrote:
Chris Angelico asked: what does a negative string look like?
This is a very good question. It looks a bit like a negative number.
>>> 2 + 2
4
>>> len('aa' + 'bb')
4
>>> len(-'bb')
-2 # Odd, I must confess.
>>> 5 +
More on negative strings. They are easier, if they only use one character.
Red Queen: What's one and one and one and one and one and one and one and
one and one and one and one and one and one?
Alice: I don't know. I lost count.
Red Queen: She can't do arithmetic.
3 --> 'aaa'
2 --> 'aa'
1 -->
Chris Angelico asked: what does a negative string look like?
This is a very good question. It looks a bit like a negative number.
>>> 2 + 2
4
>>> len('aa' + 'bb')
4
>>> len(-'bb')
-2 # Odd, I must confess.
>>> 5 + (-1)
4
>>> len('hello')
5
>>>
On Mon, Mar 25, 2019 at 9:24 PM Jonathan Fine wrote:
>
> Instead of naming these operations, we could use '+' and '-', with semantics:
>
> # Set the values of the variables.
> >>> a = 'hello '
> >>> b = 'world'
> >>> c = 'hello world'
>
> # Some values between the variables.
>
Instead of naming these operations, we could use '+' and '-', with
semantics:
# Set the values of the variables.
>>> a = 'hello '
>>> b = 'world'
>>> c = 'hello world'
# Some values between the variables.
>>> a + b == c
True
>>> a == c - b
True
>>> b = -a
25 matches
Mail list logo