PEP 616 -- String methods to remove prefixes and suffixes
is available here: https://www.python.org/dev/peps/pep-0616/
Changes:
- Only accept single affixes, not tuples
- Make the specification more concise
- Make fewer stylistic prescriptions for usage
- Fix typos
A reference implementation GitH
On Sat, Mar 28, 2020 at 11:28 AM Ivan Pozdeev via Python-Dev
wrote:
>
> On 26.03.2020 19:24, Ethan Furman wrote:
> > Before Enum, the repr for socket.AF_UNIX was:
> >
> > 1
> >
> > Not very useful for debugging.
>
> On the contrary, it's perfect. I know everything I need: it's an integer
> consta
On 03/27/2020 05:21 PM, Ivan Pozdeev via Python-Dev wrote:
On 26.03.2020 19:24, Ethan Furman wrote:
On 03/25/2020 06:53 PM, Ivan Pozdeev via Python-Dev wrote:
A diagnostic is always done by the same algorithm:
1) Identify the exact place in code where the problem manifests itself
2) Examine
Ivan Pozdeev wrote:
> More information is not better if that information is harmful rather than
helpful.
While that argument does apply in some cases, I'd have to very much
disagree that "" is harmful in comparison to just "1";
it clearly shows the value on the right side of the colon. As for the
On 26.03.2020 19:24, Ethan Furman wrote:
On 03/25/2020 06:53 PM, Ivan Pozdeev via Python-Dev wrote:
A diagnostic is always done by the same algorithm:
1) Identify the exact place in code where the problem manifests itself
2) Examine the state of the program at that moment to find out which if
On Fri, Mar 27, 2020 at 3:29 PM Dennis Sweeney
wrote:
> > > One may also continue using ``startswith()``
> > > and ``endswith()``
> > > methods for control flow instead of testing the lengths as above.
> > >
> > > That's worse, in a sense, since "foofoobar".removeprefix("foo") returns
> > "foobar
> > One may also continue using ``startswith()``
> > and ``endswith()``
> > methods for control flow instead of testing the lengths as above.
> >
> > That's worse, in a sense, since "foofoobar".removeprefix("foo") returns
> "foobar" which still starts with "foo".
I meant that startswith might be
On Fri, Mar 27, 2020 at 1:55 PM Dennis Sweeney
wrote:
> I like how that would take the pressure off of the Python sample. How's
> something like this?
>
> Specification
> =
>
> The builtin ``str`` class will gain two new methods which will behave
> as follows when ``ty
I like how that would take the pressure off of the Python sample. How's
something like this?
Specification
=
The builtin ``str`` class will gain two new methods which will behave
as follows when ``type(self) is str``::
def removeprefix(self: str, prefix: str,
How about just presenting pseudo code with the caveat that that's for the
base str and bytes classes only, and then stipulating that for subclasses
the return value is still a str/bytes/bytearray instance, and leaving it at
that? After all the point of the Python code is to show what the C code
sho
I was trying to start with the the intended behavior of the str class, then
move on to generalizing to other classes, because I think completing a single
example and *then* generalizing is an instructional style that's easier to
digest, whereas intermixing all of the examples at once can get con
I appreciate the input and attention to detail!
Using the ``str()`` constructor was sort of what I had thought originally, and
that's why I had gone overboard with "casting" in one iteration of the sample
code. When I realized that this isn't quite "casting" and that ``__str__`` can
be overridd
ACTIVITY SUMMARY (2020-03-20 - 2020-03-27)
Python tracker at https://bugs.python.org/
To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.
Issues counts and deltas:
open7357 ( -1)
closed 44486 (+66)
total 51843 (+65)
Open issues wi
On Wed, Mar 25, 2020 at 5:42 PM Dennis Sweeney
wrote:
> I'm removing the tuple feature from this PEP. So now, if I understand
> correctly, I don't think there's disagreement about behavior, just about
> how that behavior should be summarized in Python code.
> [...]
> return (the original obje
Benjamin: now that PyCon 2020 has been cancelled, are you considering
releasing 2.7.18 slightly earlier?
--
Sumana Harihareswara
Changeset Consulting
https://changeset.nyc
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email
Hello Victor.
Thank you.
The tips help me a lot.
I think the tip needs to stay inside on document to reduce time to seach
soluction.
Thanks.
Att.
Leandro Müller
De: Victor Stinner
Enviado: Thursday, March 26, 2020 7:08:42 PM
Para: Leandro Müller
Cc: python-dev@p
Hi.
I need to clean memory on function on PyEval_SetTrace.
When the python code run a while test, the memory consumption goes up a lot
(99% of the system).
exemple:
while 1 == 1:
pass
My trace function is simple.
static map session_debug_user;
char *user_console;
int trace_trampoline(
On Sun, Mar 22, 2020 at 05:00:10AM -, Dennis Sweeney wrote:
> I like "removeprefix" and "removesuffix". My only concern before had
> been length, but three more characters than "cut***fix" is a small
> price to pay for clarity.
I personally rely on auto-complete of my editor while writing. So,
Hello.
I need to start C trace the thread after to start, its to reduce of the time of
the process.
I had a lot performance changes sys.trace to C trace, but I need to reduce more
time.
Are there any soluction to set trace during thead runtime?
Att.
Leandro Müller
_
19 matches
Mail list logo