[Python-Dev] Re: Proliferation of tstate arguments.

2020-03-20 Thread Nick Coghlan
On Wed., 18 Mar. 2020, 8:36 pm Mark Shannon, wrote: > > > On 17/03/2020 7:00 pm, Steve Dower wrote: > > On 17Mar2020 1803, Chris Angelico wrote: > >> On Wed, Mar 18, 2020 at 3:50 AM Mark Shannon wrote: > >>> The accessibility of a thread-local variable is a strict superset of > >>> that of a

[Python-Dev] Re: Changing layout of f_localsplus in frame objects

2020-03-20 Thread Skip Montanaro
> ... I would expect the FastToLocals and LocalsToFast functions to require > some non-trivial adjustments ... Thanks, Nick. I'm making precisely that change in a few places in frameobject.c. One loop for locals, another for cells & frees, a third for the stack (where the active stack is

[Python-Dev] Re: Changing layout of f_localsplus in frame objects

2020-03-20 Thread Nick Coghlan
On Wed., 18 Mar. 2020, 3:24 am Skip Montanaro, wrote: > (Apologies if you're seeing this twice. I first posted to the > discourse instance.) > > I first worked on a register-based virtual machine in the 1.5.2 > timeframe. That was before PEP 227 (closures) landed. Prior to that, > local

[Python-Dev] Re: Proliferation of tstate arguments.

2020-03-20 Thread Stephen J. Turnbull
Victor Stinner writes: > Le jeu. 19 mars 2020 à 02:17, Kyle Stanley a écrit : > > Agreed; a PEP (even if it's just informational) would go a long way in > > helping to clear up some misunderstandings. > > I am still moving blindly in the darkness of CPython internals and so > I don't feel

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

2020-03-20 Thread Cameron Simpson
On 20Mar2020 13:57, Eric Fahlgren wrote: On Fri, Mar 20, 2020 at 11:56 AM Dennis Sweeney wrote: If ``s`` is one these objects, and ``s`` has ``pre`` as a prefix, then ``s.cutprefix(pre)`` returns a copy of ``s`` in which that prefix has been removed. If ``s`` does not have ``pre`` as a

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

2020-03-20 Thread Nathaniel Smith
On Fri, Mar 20, 2020 at 11:54 AM Dennis Sweeney wrote: > This is a proposal to add two new methods, ``cutprefix`` and > ``cutsuffix``, to the APIs of Python's various string objects. The names should use "start" and "end" instead of "prefix" and "suffix", to reduce the jargon factor and for

[Python-Dev] (no subject)

2020-03-20 Thread Dennis Sweeney
Thanks for the review! > In short, I propose: > def cutprefix(self: str, prefix: str, /) -> str: > if self.startswith(prefix) and prefix: > return self[len(prefix):] > else: > return self > > I call startswith() before testing if pre is non-empty to inherit of >

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

2020-03-20 Thread MRAB
On 2020-03-20 21:49, Dennis Sweeney wrote: For clarity, I'll change If ``s`` does not have ``pre`` as a prefix, an unchanged copy of ``s`` is returned. to If ``s`` does not have ``pre`` as a prefix, then ``s.cutprefix(pre)`` returns ``s`` or an unchanged copy of ``s``. For

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

2020-03-20 Thread Victor Stinner
Hi Dennis, Thanks for writing a proper PEP. It easier to review a specification than an implementation. Le ven. 20 mars 2020 à 20:00, Dennis Sweeney a écrit : > Abstract > > > This is a proposal to add two new methods, ``cutprefix`` and > ``cutsuffix``, to the APIs of Python's various

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

2020-03-20 Thread Dennis Sweeney
For clarity, I'll change If ``s`` does not have ``pre`` as a prefix, an unchanged copy of ``s`` is returned. to If ``s`` does not have ``pre`` as a prefix, then ``s.cutprefix(pre)`` returns ``s`` or an unchanged copy of ``s``. For consistency with the Specification section, I'll

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

2020-03-20 Thread Eric Fahlgren
On Fri, Mar 20, 2020 at 11:56 AM Dennis Sweeney wrote: > If ``s`` is one these objects, and ``s`` has ``pre`` as a prefix, then > ``s.cutprefix(pre)`` returns a copy of ``s`` in which that prefix has > been removed. If ``s`` does not have ``pre`` as a prefix, an > unchanged copy of ``s`` is

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

2020-03-20 Thread Dennis Sweeney
Dennis Sweeney wrote: > to say that the structure of how the methods are named should how their > behavior relates ...should be a reminder of how... ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to

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

2020-03-20 Thread Dennis Sweeney
Thanks for the feedback! I meant mnemonic as in the broader sense of "way of remembering things", not some kind of rhyming device or acronym. Maybe "mnemonic" isn't the perfect word. I was just trying to say that the structure of how the methods are named should how their behavior relates to

[Python-Dev] Requesting review on PEP 615 C Extension Reference Implementation

2020-03-20 Thread Paul Ganssle
Hi all, The past few weeks I've been working on adding a C extension to the reference implementation for PEP 615 (Support for the IANA Time Zone Database in the Standard Library - PEP link ), but I've had some trouble inducing anyone to review the code

[Python-Dev] Re: [bpo-22699] Cross-compiling and fixing sysconfig

2020-03-20 Thread Matthias Klose
distutils is pretty indifferent to whether it's building native or cross. The idea is to run the host python with the target's sysconfig to provide the tools needed for cross compilation. Yes, there are problems if third-party modules are using the sys module to reason about the target

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

2020-03-20 Thread Ethan Furman
On 03/20/2020 11:52 AM, Dennis Sweeney wrote: Browser Link: https://www.python.org/dev/peps/pep-0616/ PEP: 616 Title: String methods to remove prefixes and suffixes Thank you, Dennis, for putting this together! And Eric for sponsoring. :) Overall I think it's a good idea, but...

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

2020-03-20 Thread Dennis Sweeney
Browser Link: https://www.python.org/dev/peps/pep-0616/ PEP: 616 Title: String methods to remove prefixes and suffixes Author: Dennis Sweeney Sponsor: Eric V. Smith Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 19-Mar-2020 Python-Version: 3.9 Post-History: 30-Aug-2002

[Python-Dev] Re: Proliferation of tstate arguments.

2020-03-20 Thread Victor Stinner
Le jeu. 19 mars 2020 à 02:17, Kyle Stanley a écrit : > Agreed; a PEP (even if it's just informational) would go a long way in > helping to clear up some misunderstandings. I am still moving blindly in the darkness of CPython internals and so I don't feel comfortable to write a PEP which would

[Python-Dev] Summary of Python tracker Issues

2020-03-20 Thread Python tracker
ACTIVITY SUMMARY (2020-03-13 - 2020-03-20) 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: open7358 ( +1) closed 44420 (+70) total 51778 (+71) Open issues

[Python-Dev] Re: Looking for a sponsor and feedback on PEP 616: string methods for removing prefixes and suffixes

2020-03-20 Thread Eric V. Smith
I'll sponsor it. Eric On 3/20/2020 11:29 AM, Dennis Sweeney wrote: Hello all! I'm a relatively new contributor looking for a Core Dev sponsor for the following PEP: https://github.com/python/peps/pull/1332 Related: - Python-Ideas Thread:

[Python-Dev] Looking for a sponsor and feedback on PEP 616: string methods for removing prefixes and suffixes

2020-03-20 Thread Dennis Sweeney
Hello all! I'm a relatively new contributor looking for a Core Dev sponsor for the following PEP: https://github.com/python/peps/pull/1332 Related: - Python-Ideas Thread: https://mail.python.org/archives/list/python-id...@python.org/thread/RJARZSUKCXRJIP42Z2YBBAEN5XA7KEC3/ - Bug Tracker Issue: