[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations Using Descriptors, round 2

2021-04-12 Thread Eric V. Smith
I'm a big fan of this PEP, for many reasons. But the fact that it addresses some of the issues with get_type_hints() is very important. dataclasses avoids calling get_type_hints() for performance reasons and because it doesn't always succeed, see https://github.com/python/typing/issues/508. I b

[Python-Dev] Re: Revive PEP 396 -- Module Version Numbers ?

2021-04-14 Thread Eric V. Smith
On 4/14/2021 12:38 PM, Christopher Barker wrote: Anyway, the question now for me is whether this is worth any more of my time. So: - Is there someone willing to sponsor? - Do folks generally think there's a chance of it being accepted without a huge debate and expansion of scope. I think

[Python-Dev] Re: In support of PEP 649

2021-04-17 Thread Eric V. Smith
On 4/17/2021 12:28 AM, Christopher Barker wrote: I wonder if anyone has considered the impact of PEP 563 on dataclasses ? I have! I did find this SO post: https://stackoverflow.com/questions/52171982/new-annotations-break-inspection-of-dataclasses

[Python-Dev] Re: In support of PEP 649

2021-04-17 Thread Eric V. Smith
On 4/17/2021 6:44 PM, Christopher Barker wrote: On Sat, Apr 17, 2021 at 6:12 AM Eric V. Smith <mailto:e...@trueblade.com>> wrote: I wonder if anyone has considered the impact of PEP 563 on dataclasses ? I have! Thanks Eric. In retrospect, that field probably sh

[Python-Dev] Re: str() vs format(): trivia question

2021-04-20 Thread Eric V. Smith
On 4/20/2021 10:56 AM, Ethan Furman wrote: urllib.urlencode currently uses `str()` on its non-bytes objects before encoding the result.  This causes a compatibility break when integer module constants are converted to IntEnum, as `str(IntEnum.MEMBER)` no longer returns the integer representatio

[Python-Dev] Re: str() vs format(): trivia question

2021-04-20 Thread Eric V. Smith
On 4/20/2021 11:13 AM, Eric V. Smith wrote: On 4/20/2021 10:56 AM, Ethan Furman wrote: urllib.urlencode currently uses `str()` on its non-bytes objects before encoding the result.  This causes a compatibility break when integer module constants are converted to IntEnum, as `str

[Python-Dev] Re: Existing asyncio features scheduled for removal in Python 3.9 and 3.10

2021-05-02 Thread Eric V. Smith
> On May 2, 2021, at 4:25 PM, Illia Volochii wrote: > >  >> >> I would prefer to wait for 3.11 to remove more deprecated features, >> these ones can survive a little bit longer. >> >> If possible, I suggest to remove functions at the beginning of a new >> Python development cycle, rather than

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 7:48 AM, Petr Viktorin wrote: On 13. 05. 21 11:45, Antoine Pitrou wrote: Le 13/05/2021 à 11:40, Irit Katriel a écrit : On Thu, May 13, 2021 at 10:28 AM Antoine Pitrou > wrote:  I agree that is a reasonable spelling. I initially suggested , b

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 10:02 AM, Tal Einat wrote: On Thu, May 13, 2021 at 4:31 PM Eric V. Smith wrote: I do think a python-wide standard for this would be helpful, but I don't see how to change existing code given backward compatibility constraints. While we're on the subject, these sent

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
  at 0x02825DF09650>, limit=None, file=None, chain=True) On 5/13/21 5:37 AM, Eric V. Smith wrote: The help looks like: field(*, default=0x6fe46610>,    default_factory=0x6fe46610>,    init=True, repr=True, hash=None, compare=True, metadata=N

[Python-Dev] Re: The repr of a sentinel

2021-05-13 Thread Eric V. Smith
On 5/13/2021 1:39 PM, Tal Einat wrote: On Thu, May 13, 2021 at 7:44 PM Ethan Furman wrote: Consider me complaining. ;-) +1 An actual Sentinel class would be helpful: >>> class Sentinel: ... def __init__(self, repr): ... self.repr = repr ... def __r

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread Eric V. Smith
On 5/20/2021 3:24 PM, Ronald Oussoren via Python-Dev wrote: On 20 May 2021, at 19:10, Luciano Ramalho > wrote: I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) is not a good sentinel. It's a pickable singleton testable with `is`, readily available,

[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-24 Thread Eric V. Smith
python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/GT5DNA7RKRLFWE3V42OTWB7X5ER7KNSL/ Code of Conduct: http://python.org/psf/codeofconduct/ -- Eric V. Smith _

[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-25 Thread Eric V. Smith
On 6/24/2021 11:28 PM, Guido van Rossum wrote: On Thu, Jun 24, 2021 at 10:34 AM micro codery > wrote: As pointed out already, f-strings and format are subtly different (not counting that one can eval and the other cannot). Besides quoting, the f-sting mini l

[Python-Dev] Re: Is the Python review process flawed?

2021-07-01 Thread Eric V. Smith
On 7/1/2021 7:39 PM, esmeraldagar...@byom.de wrote: "Merging something is also a responsibility to whoever does it" - And it's also a responsibility to fix bugs, no? I don't get why you're so afraid of (maybe!) introducing a new bug when there already (certainly!) is a bug. Because the new bu

[Python-Dev] Re: Devguide document on PEG parser

2021-08-05 Thread Eric V. Smith
I’ve only just started to read this, but thanks so much for writing it, Pablo. It will be a great help. -- Eric > On Aug 4, 2021, at 5:05 PM, Pablo Galindo Salgado wrote: > >  > Hi, > > After some effort, I just finished a new extensive document in the devguide > regarding how > to use the

[Python-Dev] PEP 649: Deferred Evaluation Of Annotations

2021-08-09 Thread Eric V. Smith
I'd like to revive the discussion of PEP 649 [https://www.python.org/dev/peps/pep-0649/] that started shortly before development of 3.10 features was closed. This is Larry's PEP to defer evaluation of __annotations__ until it's actually accessed. During the discussion the decision was made to b

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-09 Thread Eric V. Smith
KDDOVT47B54T/ "PEP 563 and 649: The Great Compromise": https://mail.python.org/archives/list/python-dev@python.org/message/WUZGTGE43T7XV3EUGT6AN2N52OD3U7AE/ I'm sure there are other threads I missed. -- Eric On 8/9/2021 11:27 AM, Eric V. Smith wrote: I'd like to

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-10 Thread Eric V. Smith
On 8/9/2021 11:25 PM, Inada Naoki wrote: On Tue, Aug 10, 2021 at 12:30 AM Eric V. Smith wrote: Personally, I'd like to see PEP 649 accepted. There are a number of issues on bpo where people expect dataclass's field.type to be an actual Python object representing a type, and not a st

[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations

2021-08-11 Thread Eric V. Smith
On 8/11/2021 11:07 AM, Jukka Lehtosalo wrote: On Wed, Aug 11, 2021 at 2:56 PM Thomas Grainger > wrote: Would: ``` @dataclass class Node:     global_node: __class__ | None ``` "Just work" with co_annotations? This feels too specialized to m

[Python-Dev] Re: Should we try to get a complete draft of What's New by b1?

2021-08-11 Thread Eric V. Smith
to specifically pick on Eric V. Smith, but yesterday a co-worker came to me asking about `KW_ONLY` for dataclasses and wanting to provide feedback (https://docs.python.org/3.10/library/dataclasses.html#dataclasses.KW_ONLY <https://docs.python.org/3.10/library/dataclasses.html#dataclasses.KW_

[Python-Dev] Re: Should PEP 8 be updated for Python 3 only?

2021-08-25 Thread Eric V. Smith
I think we’re better off removing them. 2.7 is completely unsupported by us. Why do you think they should still be kept? -- Eric > On Aug 25, 2021, at 1:32 PM, Mike Miller wrote: > >  > How about moving Python 2 notes into a section at the bottom? > > > -Mike >

[Python-Dev] Re: f-strings in the grammar

2021-09-20 Thread Eric V. Smith
On 9/20/2021 11:21 AM, Terry Reedy wrote: On 9/20/2021 8:46 AM, Serhiy Storchaka wrote: 20.09.21 14:18, Pablo Galindo Salgado пише: * The parser will likely have "\n" characters and backslashes in f-strings expressions, which currently is impossible: What about characters "\x7b", "\x7d", "\x5

[Python-Dev] Re: f-strings in the grammar

2021-09-20 Thread Eric V. Smith
On 9/20/2021 11:19 AM, Terry Reedy wrote: On 9/20/2021 7:18 AM, Pablo Galindo Salgado wrote: there are some interesting things we **could** (emphasis on could) get out of this and I wanted to discuss what people think about them. * The parser will allow nesting quote characters. This means th

[Python-Dev] Re: f-strings in the grammar

2021-09-21 Thread Eric V. Smith
To bring this back on track, I'll try and answer the questions from your original email. On 9/20/2021 7:18 AM, Pablo Galindo Salgado wrote: I have started a project to move the parsing off-strings to the parser and the grammar. Appart from some maintenance improvements (we can drop a considerab

[Python-Dev] Re: f-strings in the grammar

2021-09-21 Thread Eric V. Smith
On 9/21/2021 7:15 PM, Guido van Rossum wrote: On Tue, Sep 21, 2021 at 4:08 PM Steve Dower <mailto:steve.do...@python.org>> wrote: On 9/21/2021 7:42 PM, Eric V. Smith wrote: > I don't recall exactly why, but I disallowed backslashes inside > expressions at the la

[Python-Dev] Changing exception text in micro releases

2021-09-24 Thread Eric V. Smith
This PR https://github.com/python/cpython/pull/28310 changes the message for some exceptions. Currently: >>> format('', '%M') Traceback (most recent call last):   File "", line 1, in ValueError: Invalid format specifier With the proposed change: >>> format('', '%M') Traceback (most recent cal

[Python-Dev] Re: Changing exception text in micro releases

2021-09-24 Thread Eric V. Smith
On 9/24/2021 10:39 AM, Ethan Furman wrote: On 9/24/21 6:51 AM, Eric V. Smith wrote: > This is clearly an improvement. My question is: is it okay to backport this to 3.9 and 3.10? I > think we have a rule that it's okay to change the exception text, but I'm not sure how th

[Python-Dev] Re: Changing exception text in micro releases

2021-09-24 Thread Eric V. Smith
jre...@udel.edu>> wrote: On 9/24/2021 10:46 AM, Eric V. Smith wrote: > On 9/24/2021 10:39 AM, Ethan Furman wrote: >> On 9/24/21 6:51 AM, Eric V. Smith wrote: >> >> >> > This is clearly an improvement. My question is: is it okay to &

[Python-Dev] Re: The Default for python -X frozen_modules.

2021-09-28 Thread Eric V. Smith
On 9/28/2021 8:36 AM, Victor Stinner wrote: On Mon, Sep 27, 2021 at 6:58 PM Eric Snow wrote: We've frozen most of the stdlib modules imported during "python -c pass" [1][2], to make startup a bit faster. Import of those modules is controlled by "-X frozen_modules=[on|off]". Currently it defau

[Python-Dev] Re: The Default for python -X frozen_modules.

2021-09-28 Thread Eric V. Smith
On 9/28/2021 9:10 AM, Antoine Pitrou wrote: On Tue, 28 Sep 2021 08:55:05 -0400 "Eric V. Smith" wrote: So I prefer to teach everybody how to use "-X frozen_modules=off" if they want to hack the stdlib for their greatest pleasure. I prefer that such special use case requi

[Python-Dev] Re: The Default for python -X frozen_modules.

2021-09-28 Thread Eric V. Smith
On 9/28/2021 9:17 AM, Antoine Pitrou wrote: On Tue, 28 Sep 2021 09:14:38 -0400 "Eric V. Smith" wrote: On 9/28/2021 9:10 AM, Antoine Pitrou wrote: On Tue, 28 Sep 2021 08:55:05 -0400 "Eric V. Smith" wrote: So I prefer to teach everybody how to use "-X frozen_modules=

Re: [Python-Dev] [Python-checkins] cpython (3.3): Whatsnew typo

2013-04-02 Thread Eric V. Smith
On 4/2/2013 5:15 PM, Eric V. Smith wrote: > On 10/3/2012 8:59 PM, jesus.cea wrote: >> >> -Solaris and derived platforms have a new class :class:`select.devpoll` >> -for high performance asyncronous sockets via :file:`/dev/poll`. >> +Solaris and derivatives platfo

Re: [Python-Dev] [Python-checkins] cpython (3.3): Whatsnew typo

2013-04-02 Thread Eric V. Smith
On 10/3/2012 8:59 PM, jesus.cea wrote: > > -Solaris and derived platforms have a new class :class:`select.devpoll` > -for high performance asyncronous sockets via :file:`/dev/poll`. > +Solaris and derivatives platforms have a new class :class:`select.devpoll` > +for high performance asynchronous

Re: [Python-Dev] enum discussion: can someone please summarize open issues?

2013-05-04 Thread Eric V. Smith
On 5/4/2013 2:42 AM, Nick Coghlan wrote: > On Sat, May 4, 2013 at 4:10 PM, Georg Brandl wrote: >> Am 04.05.2013 01:22, schrieb Antoine Pitrou: >>> On Sat, 04 May 2013 11:15:17 +1200 >>> Greg Ewing wrote: Eli Bendersky wrote: > I'm just curious what it is about enums that sets everyone on

Re: [Python-Dev] PEP 409 and the stdlib

2013-05-20 Thread Eric V. Smith
On May 20, 2013, at 11:46 AM, Antoine Pitrou wrote: > On Mon, 20 May 2013 07:12:07 -0700 > Ethan Furman wrote: >> >> As a case in point, base64.py is currently getting a bug fix, and also >> contains this code: >> >> def b32decode(s, casefold=False, map01=None): >> . >> . >> . >

Re: [Python-Dev] stat module in C -- what to do with stat.py?

2013-06-20 Thread Eric V. Smith
On 6/20/2013 9:40 AM, Nick Coghlan wrote: > On 20 June 2013 23:29, Christian Heimes wrote: >> Am 20.06.2013 15:21, schrieb Florent: >>> we already have "_pyio.py", we could have "_pystat.py". >> >> Works for me. > > I suggest following the guidelines in PEP 399 for cross implementation > compatib

Re: [Python-Dev] stat module in C -- what to do with stat.py?

2013-06-20 Thread Eric V. Smith
On 6/20/2013 4:53 PM, Victor Stinner wrote: > 2013/6/20 Eric V. Smith >: >> But isn't the real problem with this module in Python the fact that the >> constants might be wrong? I'm not sure what, if anything, we can do >> about that. > > Python is provi

Re: [Python-Dev] stat module in C -- what to do with stat.py?

2013-06-21 Thread Eric V. Smith
On 6/21/2013 7:39 AM, Nick Coghlan wrote: > On 21 June 2013 17:25, Victor Stinner wrote: >> 2013/6/21 Nick Coghlan : >>> Because practicality beats purity. This "wrong" Python code has been >>> good enough for all Python version up until 3.4, it makes sense to >>> keep it as a fallback instead of

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-25 Thread Eric V. Smith
On 6/25/2013 9:33 PM, Senthil Kumaran wrote: > > > > On Tue, Jun 25, 2013 at 5:58 PM, Benjamin Peterson > wrote: > > 2013/6/25 Victor Stinner >: > > And then I ran "make distclean"... > > You've left us hanging... >

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-26 Thread Eric V. Smith
On 6/26/2013 6:43 AM, a.cava...@cavallinux.eu wrote: > .. or having hg "purging" unwanted build artifact (probably cleaning up > the .hgignore file first) How would that work? How could hg purge the .bak, .orig, .rej, .old, etc. files? >>> find $(srcdir)/* ... >>> >>> to avoid this problem. It wo

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-26 Thread Eric V. Smith
On 6/26/2013 8:18 AM, Eric V. Smith wrote: > On 6/26/2013 6:43 AM, a.cava...@cavallinux.eu wrote: >> .. or having hg "purging" unwanted build artifact (probably cleaning up >> the .hgignore file first) > > How would that work? How could hg purge the .bak,

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-26 Thread Eric V. Smith
On 6/26/2013 8:44 AM, Oleg Broytman wrote: > On Wed, Jun 26, 2013 at 08:18:27AM -0400, "Eric V. Smith" > wrote: >>>>> find $(srcdir)/* ... >>>>> >>>>> to avoid this problem. It won't expand the .hg top-level directory. >>

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-26 Thread Eric V. Smith
On 6/26/2013 8:57 AM, Ronald Oussoren wrote: > > On 26 Jun, 2013, at 14:18, Eric V. Smith wrote: > >> On 6/26/2013 6:43 AM, a.cava...@cavallinux.eu wrote: >>> .. or having hg "purging" unwanted build artifact (probably cleaning up >>> the .hgignore

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-06-26 Thread Eric V. Smith
On 6/26/2013 9:02 AM, Eric V. Smith wrote: > On 6/26/2013 8:44 AM, Oleg Broytman wrote: >> On Wed, Jun 26, 2013 at 08:18:27AM -0400, "Eric V. Smith" >> wrote: >>>>>> find $(srcdir)/* ... >>>>>> >>>>>> to avoid th

Re: [Python-Dev] End of the mystery "@README.txt Mercurial bug"

2013-07-01 Thread Eric V. Smith
On 7/1/2013 5:13 PM, R. David Murray wrote: > distclean still needs to be fixed, so please open a new issue for > adding buildclean or whatever you want to call it, as Eric requested > in the existing issue. I finally got around to testing it today, so I'm going to check in my change to 18312 some

[Python-Dev] Issue 18312 "fix" broke buildbots

2013-07-02 Thread Eric V. Smith
I'm not sure how my change broke the buildbots, but apparently it did. I need to run to a meeting now, but I can roll this back in the next few hours. If someone else wants to roll it back before I get to it, feel free. Sorry about the problem. I tested it locally, I'm not sure how the buildbots

Re: [Python-Dev] Issue 18312 "fix" broke buildbots

2013-07-02 Thread Eric V. Smith
On 07/02/2013 10:33 AM, R. David Murray wrote: > On Tue, 02 Jul 2013 09:52:56 -0400, "Eric V. Smith" > wrote: >> I'm not sure how my change broke the buildbots, but apparently it did. I >> need to run to a meeting now, but I can roll this back in the next fe

Re: [Python-Dev] [Python-checkins] cpython (3.3): let's not return NULL from functions that should return ints

2013-07-22 Thread Eric V. Smith
[re-sending to python-dev] On 7/21/2013 4:27 PM, benjamin.peterson wrote: > @@ -267,7 +267,7 @@ > Py_DECREF(io); > Py_DECREF(binary); > PyMem_FREE(found_encoding); > -return PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, filename); > +return 0; >

Re: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)

2013-07-24 Thread Eric V. Smith
On 7/24/2013 6:25 PM, Guido van Rossum wrote: >>> To reduce the need for 3rd party subprocess creation code, we should >>> have better daemon creation code in the stdlib -- I wrote some damn >>> robust code for this purpose in my previous job, but it never saw the >>> light of day. >> >> What do yo

Re: [Python-Dev] format, int, and IntEnum

2013-08-15 Thread Eric V. Smith
On 8/15/2013 12:27 AM, Nick Coghlan wrote: > I think Eric is overinterpreting the spec, there. While that particular > sentence requires that the empty format string will be equivalent to a > plain str() operation for builtin types, it is only a recommendation for > other types. For enums, I believ

Re: [Python-Dev] format, int, and IntEnum

2013-08-15 Thread Eric V. Smith
On Aug 15, 2013, at 10:59 AM, Eli Bendersky wrote: > > > > On Thu, Aug 15, 2013 at 3:03 AM, Eric V. Smith wrote: >> On 8/15/2013 12:27 AM, Nick Coghlan wrote: >> > I think Eric is overinterpreting the spec, there. While that particular >> > sentence requir

Re: [Python-Dev] format, int, and IntEnum

2013-08-15 Thread Eric V. Smith
On Aug 15, 2013, at 11:36 AM, Eli Bendersky wrote: > > > > On Thu, Aug 15, 2013 at 8:15 AM, Eric V. Smith wrote: >> On Aug 15, 2013, at 10:59 AM, Eli Bendersky wrote: >> >>> >>> >>> >>> On Thu, Aug 15, 2013 at 3:03 AM, Eric V.

Re: [Python-Dev] format, int, and IntEnum

2013-08-15 Thread Eric V. Smith
On 08/15/2013 11:06 AM, Nick Coghlan wrote: > On 15 August 2013 05:03, Eric V. Smith wrote: >> On 8/15/2013 12:27 AM, Nick Coghlan wrote: >>> I think Eric is overinterpreting the spec, there. While that particular >>> sentence requires that the empty format str

Re: [Python-Dev] format, int, and IntEnum

2013-08-15 Thread Eric V. Smith
On 08/15/2013 11:21 AM, Ethan Furman wrote: > Given that the !r and !s format codes can be used to get the repr and > str of an IntEnum, would it be acceptable to have IntEnum's __format__ > simply pass through to int's __format__? And likewise with all mix-in > classes? That helps with str.forma

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eric V. Smith
On 08/15/2013 01:58 PM, Mark Dickinson wrote: > On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano > wrote: > > > - Each scheme ended up needing to be a separate function, for ease > of both implementation and testing. So I had four private median > function

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eric V. Smith
On 8/15/2013 2:24 PM, R. David Murray wrote: > On Thu, 15 Aug 2013 14:10:39 -0400, "Eric V. Smith" > wrote: >> On 08/15/2013 01:58 PM, Mark Dickinson wrote: >>> On Thu, Aug 15, 2013 at 2:08 PM, Steven D'Aprano >> <mailto:st...@pearwood.info>> wr

Re: [Python-Dev] PEP 450 adding statistics module

2013-08-15 Thread Eric V. Smith
On 8/15/2013 10:44 PM, Steven D'Aprano wrote: > On 16/08/13 04:10, Eric V. Smith wrote: > >> I agree with Mark: the proposed median, median.low, etc., doesn't feel >> right. Is there any example of doing this in the stdlib? > > The most obvious case is

Re: [Python-Dev] Add a "transformdict" to collections

2013-09-10 Thread Eric V. Smith
On 09/10/2013 11:54 AM, Janzert wrote: > On 9/10/2013 10:54 AM, Antoine Pitrou wrote: >> (also, I would intuitively expect the latest key to be held, not the >> first one, since that's what happens for values.) >> >> Regards >> >> Antoine. >> > > I intuitively expected, and I think most often woul

Re: [Python-Dev] Add a "transformdict" to collections

2013-09-10 Thread Eric V. Smith
On 9/10/2013 6:18 PM, Ethan Furman wrote: > On 09/10/2013 03:12 PM, MRAB wrote: >> On 10/09/2013 22:46, Antoine Pitrou wrote: >>> On Tue, 10 Sep 2013 18:44:20 -0300 >>> "Joao S. O. Bueno" wrote: On 10 September 2013 18:06, Antoine Pitrou wrote: > On Tue, 10 Sep 2013 17:38:26 -0300

Re: [Python-Dev] [Python-checkins] cpython (merge 3.3 -> default): Fix http.server's request handling case on trailing '/'.

2013-09-13 Thread Eric V. Smith
On 9/13/2013 3:22 AM, senthil.kumaran wrote: > http://hg.python.org/cpython/rev/b85c9d2a5227 > changeset: 85672:b85c9d2a5227 > parent: 85668:66ec8431032d > parent: 85671:1fcccbbe15e2 > user:Senthil Kumaran > date:Fri Sep 13 00:22:45 2013 -0700 > summary: > Fix http.se

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Eric V. Smith
On 9/27/2013 9:14 PM, Brett Cannon wrote: > I don't see any issue with redirecting the discussion. python-tulip@ is > acting like a SIG for the module, so no real precedent beyond it not > being hosted as a mail.python.org list. I'm sure I'm in the minority, but I'd like

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-30 Thread Eric V. Smith
On 09/29/2013 08:55 PM, Guido van Rossum wrote: > On Sun, Sep 29, 2013 at 5:40 PM, Eric V. Smith <mailto:e...@trueblade.com>> wrote: > > On 9/27/2013 9:14 PM, Brett Cannon wrote: > > > I don't see any issue with redirecting the discussion. > pyt

Re: [Python-Dev] lzma and 'x' mode open

2013-10-08 Thread Eric V. Smith
Please open a bug report on bugs.python.org so this doesn't get lost. -- Eric. > On Oct 8, 2013, at 8:49 PM, Tim Heaney wrote: > > I love the 'x' mode open in recent versions of Python. I just discovered that > lzma.open doesn't support it. It seems there's an elif that explicitly checks > t

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-11 Thread Eric V. Smith
On 10/11/2013 5:00 AM, Antoine Pitrou wrote: > > Let me answer here to Nick's argument on the tracker (made last year, > before the patch was committed): > >> As with many context managers, a key benefit here is in the priming >> effect for readers. In this code: >> >> try: >># Whatev

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-11 Thread Eric V. Smith
On 10/11/2013 12:43 PM, Barry Warsaw wrote: > On Oct 11, 2013, at 06:27 PM, Georg Brandl wrote: > >> Maybe to fit in with other verb-like APIs used as context managers: >> it's open() not opened(). > > open() predates context managers, but maybe we need a new convention. > > with ignore(FileNotF

Re: [Python-Dev] Support for marking limited API elements in C API docs

2013-10-12 Thread Eric V. Smith
On 10/12/2013 4:04 PM, Georg Brandl wrote: > Am 12.10.2013 21:56, schrieb Antoine Pitrou: >> On Sat, 12 Oct 2013 21:19:16 +0200 >> Georg Brandl wrote: >>> Am 12.10.2013 20:20, schrieb Serhiy Storchaka: 12.10.13 21:04, Georg Brandl написав(ла): > in light of the recent thread about PEPs no

Re: [Python-Dev] Making stdlib modules optional for distributions (Was: Breaking up the stdlib (Was: release cadence))

2016-07-07 Thread Eric V. Smith
On 7/6/2016 10:44 PM, Nick Coghlan wrote: The point of overlap I see is that if the stdlib starts putting some selected modules into site-packages (so "pip install --upgrade " works without any changes to pip or equivalent tools), then that also solves the "How to explicitly declare dependencies

[Python-Dev] Adding PEP 515's '_' formatting

2016-08-19 Thread Eric V. Smith
PEP 515 adds underscores to numeric literals. As part of that, it adds optional underscores to numeric formatters (similar to PEP 378 for ','). See https://www.python.org/dev/peps/pep-0515/#further-changes I had assigned myself http://bugs.python.org/issue27080 to implement this. Unfortunately

[Python-Dev] Changes to PEP 498 (f-strings)

2016-08-30 Thread Eric V. Smith
After a long discussion on python-ideas (starting at https://mail.python.org/pipermail/python-ideas/2016-August/041727.html) I'm proposing the following change to PEP 498: backslashes inside brackets will be disallowed. The point of this is to disallow convoluted code like: >>> d = {'a': 4} >>> f'

Re: [Python-Dev] [New-bugs-announce] [issue27948] f-strings: allow backslashes only in the string parts, not in the expression parts

2016-09-03 Thread Eric V. Smith
I'm aware of the buildbot failures due to this commit. I'm working on it. Sorry about that: tests passed on my machine. Eric. On 09/03/2016 09:24 AM, Eric V. Smith wrote: > > New submission from Eric V. Smith: > > See issue 27921. > > Currently (and for 3.6

[Python-Dev] What's the status of PEP 515?

2016-09-06 Thread Eric V. Smith
The implementation of '_' in numeric literals is here: http://bugs.python.org/issue26331 And to add '_' in int.__format__ is here: http://bugs.python.org/issue27080 But I don't want to add support in int.__format__ unless numeric literal support is added. So, Georg and Serhiy: is issue 26331

Re: [Python-Dev] Changes to PEP 498 (f-strings)

2016-09-09 Thread Eric V. Smith
for all of the backslash scenarios, but I'll watch the buildbots. Eric. On 8/30/2016 1:55 PM, Eric V. Smith wrote: After a long discussion on python-ideas (starting at https://mail.python.org/pipermail/python-ideas/2016-August/041727.html) I'm proposing the following change to PEP 498: ba

Re: [Python-Dev] [Python-checkins] cpython: make invalid_comma_and_underscore a real prototype

2016-09-09 Thread Eric V. Smith
Oops, thanks Benjamin. That was a copy and paste error. Eric. On 9/9/2016 11:15 PM, benjamin.peterson wrote: https://hg.python.org/cpython/rev/1e7b636b6009 changeset: 103539:1e7b636b6009 user:Benjamin Peterson date:Fri Sep 09 20:14:05 2016 -0700 summary: make invalid_comma_

Re: [Python-Dev] [Python-checkins] cpython: Use HTTP in testPythonOrg

2016-09-11 Thread Eric V. Smith
Hi, Berker. Could you add a comment to the test on why this should use http? I can see this bouncing back and forth between http and https, as people clean an up all http usages to be https. Thanks. Eric. On 9/11/2016 8:46 AM, berker.peksag wrote: https://hg.python.org/cpython/rev/bc085b7e8

Re: [Python-Dev] [Python-checkins] cpython (2.7): properly handle the single null-byte file (closes #24022)

2016-09-19 Thread Eric V. Smith
Shouldn't there be a test added for this? -- Eric. > On Sep 19, 2016, at 2:44 AM, benjamin.peterson > wrote: > > https://hg.python.org/cpython/rev/c6438a3df7a4 > changeset: 103950:c6438a3df7a4 > branch: 2.7 > parent: 103927:a8771f230c06 > user:Benjamin Peterson > date:

Re: [Python-Dev] Default formatting

2016-10-26 Thread Eric V. Smith
On 10/25/2016 5:37 AM, Serhiy Storchaka wrote: Classes that doesn't define the __format__ method for custom PEP 3101 formatting inherits it from parents. Originally the object.__format__ method was designed as [1]: def __format__(self, format_spec): return format(str(self), format_s

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-04 Thread Eric V. Smith
On 11/3/2016 3:06 PM, Fabio Zadrozny wrote: Hi Python-Dev, I'm trying to get my head around on what's accepted in f-strings -- https://www.python.org/dev/peps/pep-0498/ seems very light on the details on what it does accept as an expression and how things should actually be parsed (and the curre

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-04 Thread Eric V. Smith
On 11/4/2016 10:50 AM, Fabio Zadrozny wrote: In what way do you think the implementation isn't ready for a final release? Well, the cases listed in the docs​ (https://hg.python.org/cpython/file/default/Doc/reference/lexical_analysis.rst

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-04 Thread Eric V. Smith
On 11/4/2016 2:03 PM, Fabio Zadrozny wrote: Using PyParser_ASTFromString is the easiest possible way to do this. Given a string, it returns an AST node. What could be simpler? ​I think that for implementation purposes, given the python infrastructure, it's fine, but for specification p

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-09 Thread Eric V. Smith
On 11/9/2016 11:35 AM, Paul Moore wrote: On 9 November 2016 at 16:20, Fabio Zadrozny wrote: Also, as a feedback, I found it a bit odd that there can't be any space nor new line between the last format specifiers and '}' FWIW, that is the case for normal format strings, as well: print("{!r\n

Re: [Python-Dev] Making sure dictionary adds/deletes during iteration always raise exception

2016-12-13 Thread Eric V. Smith
> On Dec 13, 2016, at 11:42 AM, Raymond Hettinger > wrote: > > >> On Dec 13, 2016, at 1:51 AM, Max Moroz wrote: >> >> Would it be worth ensuring that an exception is ALWAYS raised if a key >> is added to or deleted from a dictionary during iteration? >> >> I suspect the cost of a more compr

Re: [Python-Dev] Making sure dictionary adds/deletes during iteration always raise exception

2016-12-13 Thread Eric V. Smith
> On Dec 13, 2016, at 12:48 PM, Guido van Rossum wrote: > >> On Tue, Dec 13, 2016 at 8:52 AM, Eric V. Smith wrote: >> >> > On Dec 13, 2016, at 11:42 AM, Raymond Hettinger >> > wrote: >> > >> >> On Dec 13, 2016, at 1:51 AM, Max Mor

Re: [Python-Dev] Split Misc/NEWS into individual files

2017-02-22 Thread Eric V. Smith
On 2/22/17 7:27 AM, Victor Stinner wrote: OpenStack happily fixed this issue one or two years ago with "reno": https://pypi.python.org/pypi/reno It's a simple tool building a changelog from a list of files: each file describe a change of a commit. The filename is the commit identifier. Simple, i

Re: [Python-Dev] Is adding support for os.PathLike an enhancement or bugfix?

2017-05-05 Thread Eric V. Smith
On 5/5/2017 3:36 PM, Chris Barker wrote: Sorry to come late to the game, It wasn't immediately clear to me what the implications were of the "enhancement or bugfix" distinction... On Thu, May 4, 2017 at 9:46 PM, Nick Coghlan > wrote: That improved casting mechan

Re: [Python-Dev] Format strings, Unicode, and Py2.7: need clarification

2017-05-17 Thread Eric V. Smith
> On May 17, 2017, at 2:41 PM, Craig Rodrigues wrote: > > Hi, > > While cleaning up some code during Python 2 -> Python 3 porting, > I switched some code to use str.format(), I found this behavor: > > Python 2.7 > = > a = "%s" % "hi" > b = "%s" % u"hi" > c = u"%s" % "hi" > d = "{}".for

Re: [Python-Dev] New work-in-progress bisection tool for the Python test suite (in regrtest)

2017-06-27 Thread Eric V. Smith
That's great, Victor. Thanks for all of your work on this. Eric. On 6/27/2017 8:39 PM, Victor Stinner wrote: 2017-06-27 7:33 GMT+02:00 Serhiy Storchaka : You could make it just a submodule in the test package. ./python -m test.bisect -R 3:3 test_os I like the idea :-) I proposed a PR w

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-12 Thread Eric V. Smith
On 11/12/2021 11:31 AM, Chris Angelico wrote: I think that proves the value of download counts: very little. The highest on the list is a thing called botocore, which I've never heard of. What is it? It's a dependency of a number of Amazon web services. My guess is that it's a dependency of popu

[Python-Dev] Re: Do we need to remove everything that's deprecated?

2021-11-14 Thread Eric V. Smith
On 11/12/2021 5:55 AM, Petr Viktorin wrote: If deprecation now means "we've come up with a new way to do things, and you have two years to switch", can we have something else that means "there's now a better way to do things; the old way is a bit worse but continues to work as before"? I th

[Python-Dev] Re: Do we need to remove everything that's deprecated?

2021-11-14 Thread Eric V. Smith
On 11/14/2021 11:39 AM, Eric V. Smith wrote: For things that really are removed (and I won't get in to the reasons for why something must be removed), I think a useful stance is "we won't remove anything that would make it hard to support a single code base across all s

[Python-Dev] Re: Optimizing literal comparisons and contains

2021-11-28 Thread Eric V. Smith
> On Nov 28, 2021, at 3:03 PM, Serhiy Storchaka wrote: > > 28.11.21 17:13, Skip Montanaro пише: >>> That is not entirely true: >>> https://github.com/python/cpython/pull/29639#issuecomment-974146979 >> >> The only places I've seen "if 0:" or "if False:" in live code was for >> debugging. Opti

[Python-Dev] Re: Optimizing literal comparisons and contains

2021-11-28 Thread Eric V. Smith
e via Python-Dev wrote: I am slightly surprised that it seems to be *easier* to fold selected constant expressions than to have more generic code to fold them all. Or at least, all those that don't contain containers, such as 1 in [0,1,2] Rob Cliffe On 28/11/20

[Python-Dev] Re: The current state of typing PEPs

2021-11-29 Thread Eric V. Smith
Here's a use case for runtime type annotations: dataclasses use annotations to define fields. With the exception of ClassVar, the actual type is ignored. There's code in dataclasses.py to deal with stringized annotations, specifically just looking for ClassVar. I'd like to see this special case

[Python-Dev] Re: Should dataclasses add__set__ (and possibly __get __) descriptors ?

2021-12-13 Thread Eric V. Smith
On 12/13/2021 1:43 AM, Vioshim wrote: Hello good morning. I've decided to open a discussion of a topic that I consider should be part of dataclasses, but not sure how suggestions work and many threads recommend to check python dev first so-. Anyways, at the moment that I write this message in

[Python-Dev] Re: issues-test-2 spam?

2021-12-27 Thread Eric V. Smith
On 12/27/2021 12:43 PM, Zachary Ware wrote: On Mon, Dec 27, 2021 at 11:29 AM Matti Picus wrote: You may want to try the experiments in a private repo under your username rather than under the python organization. I think this will prevent anyone except you from getting notified. You could eve

[Python-Dev] Re: About vulnerabilities in Cpython native code

2022-01-06 Thread Eric V. Smith
This is also at https://bugs.python.org/issue46280. Please direct comments there. Eric On 1/6/2022 8:22 AM, lxr1210--- via Python-Dev wrote: Hi all, I am currently doing some research on the security of CPython. I used the open source vulnerability analysis engine, Infer(https://fbinfer.com

[Python-Dev] Re: Minor inconvenience: f-string not recognized as docstring

2022-01-11 Thread Eric V. Smith
Constant f-strings (those without substitutions) as doc strings used to work, since the compiler turns them into normal strings. I can't find exactly where it was removed, but there was definitely discussion about it. See https://bugs.python.org/issue28739 for at least part of the discussion.

[Python-Dev] Re: Minor inconvenience: f-string not recognized as docstring

2022-01-11 Thread Eric V. Smith
ne True And there's a test to make sure constant f-strings are not doc strings: https://github.com/python/cpython/blob/dce642f24418c58e67fa31a686575c980c31dd37/Lib/test/test_fstring.py#L406 Eric -Brett -gps On Tue, Jan 11, 2022 at 8:12 AM Antoine Pitrou wrote: On Tue, 11 Jan

[Python-Dev] Re: Slowly bend the C API towards the limited API to get a stable ABI for everyone

2022-02-03 Thread Eric V. Smith
On 2/3/2022 12:15 PM, Victor Stinner wrote: I'm working bottom-to-top: prepare PyObject and PyVarObject to become opaque, *and* top-to-bottom: prepare subclasses (structures "inheriting" from PyObject and PyVarObject) to become opaque like PyFrameObject. IMO if PyObject* becomes a handle, the mi

[Python-Dev] Re: New PEP website is horrible to read on mobile device

2022-03-16 Thread Eric V. Smith
On 3/16/2022 11:23 AM, Skip Montanaro wrote: Dang auto-correct... I meant "anti-tracking," in case it wasn't obvious. It wasn't obvious! I was wondering what nefarious entity had created an anti-teaching VPN, and just what that would involve. Thanks for clarifying! Eric ___

<    1   2   3   4   5   6   >