[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-26 Thread Ethan Furman
First off, thank you for being so patient -- trying to champion a PEP can be exhausting. On 03/26/2020 05:22 PM, Dennis Sweeney wrote: Ethan Furman wrote: I don't understand that list bit -- surely, if I'm bothering to implement removeprefix and removesuffix in my subclass, I would also

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-26 Thread Dennis Sweeney
> I don't understand that list bit -- surely, if I'm bothering to implement > removeprefix and removesuffix in my subclass, I would also want > to > return self to keep my subclass? Why would I want to go through the extra > overhead of either calling my own __getitem__ method, or have the >

[Python-Dev] Re: sys.trace without alert or remove trace by C

2020-03-26 Thread Victor Stinner
Hi, I understand that you are looking for PyEval_SetTrace(NULL, NULL) to unregister a trace function set previously. Maybe the documentation should be enhanced to explain that. Do you want to propose a PR to enhance the doc?

[Python-Dev] sys.trace without alert or remove trace by C

2020-03-26 Thread Leandro Müller
Hello. I need to remove the trace on thread, but I tried to run sys.settrace(None) and return alert on console. I didn't find any soluction to remove by C, example PyEval_SetTrace(Py_None, obj), but it not works. Are there any soluction to remove without alert or by C? C is better for me.

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-26 Thread Ethan Furman
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 the values are wrong 3) Track the wrong

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-26 Thread Sebastian Rittau
Am 26.03.20 um 06:28 schrieb Cameron Simpson: On 24Mar2020 18:49, Brett Cannon wrote: -1 on "cut*" because my brain keeps reading it as "cute". +1 on "trim*" as it is clear what's going on and no confusion with preexisting methods. +1 on "remove*" for the same reasons as "trim*". I

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-26 Thread Ivan Pozdeev via Python-Dev
On 26.03.2020 11:59, Serhiy Storchaka wrote: 26.03.20 01:35, Ivan Pozdeev via Python-Dev пише: E. g. in this case, AF_UNIX is a member of some entity called "AddressFamily" -- so I would search the code for "AddressFamily" to see what I'm looking at and what else I can do with it. The fact

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-26 Thread Serhiy Storchaka
26.03.20 01:35, Ivan Pozdeev via Python-Dev пише: E. g. in this case, AF_UNIX is a member of some entity called "AddressFamily" -- so I would search the code for "AddressFamily" to see what I'm looking at and what else I can do with it. The fact that it's also directly availabe from the

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-26 Thread Serhiy Storchaka
26.03.20 01:04, Cameron Simpson пише: My concern is basicly that in normal Python usage, the names within a class (and thus the names in an enum) are named to be distinct within the class namespace. So I would not expect the names for particular values to have extra qualification (eg I expect

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-26 Thread Dennis Sweeney
> I imagine it's an implementation detail of which ones depend on > ``__getitem__``. If we write class MyStr(str): def __getitem__(self, key): raise ZeroDivisionError() then all of the assertions from before still pass, so in fact *none* of the methods rely on