[Python-Dev] Re: Retiring this mailing list ?

2023-11-14 Thread Eric V. Smith via Python-Dev
On 11/14/2023 1:21 PM, Steve Holden wrote: On Mon, 13 Nov 2023 at 10:18, Marc-Andre Lemburg wrote: [...] Question: Should we retire and archive this mailing list ? (I'm asking as one of the maintainers of the ML) [...] Hi Marc-Andre, Maybe just require senders to be members

[Python-Dev] Re: Annotating pure functions to improve inline caching/optimization

2022-09-14 Thread Eric V. Smith via Python-Dev
You should bring this up on discuss.python.org. It's not going to see much if any discussion here. Eric On 9/14/2022 10:05 AM, Philipp Burch wrote: Hello everyone, the docs on the upcoming 3.11 release state > This [specializing adaptive interpreter] also brings in another concept called in

[Python-Dev] Re: Is it possible to view tokenizer output?

2022-05-29 Thread Eric V. Smith
python -m tokenize < file-to-parse.py See the comment at the top of tokenize.py. IIRC, it re-implements the tokenizer, it does not call the one used for python code. Eric On 5/29/2022 6:59 PM, Jack wrote: Hi, I'm just getting into the CPython codebase just for fun, and I've just started mess

[Python-Dev] Re: Raw strings ending with a backslash

2022-05-28 Thread Eric V. Smith
On 5/28/2022 7:57 AM, Damian Shaw wrote: That PR seems to make \' and \" not special in general right? I think this is a more limited proposal, to only change the behavior when \ is at the end of a string, so the only behavior difference would never receiving the error "SyntaxError: EOL while

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-26 Thread Eric V. Smith
> On Apr 26, 2022, at 3:05 PM, Thomas Kehrenberg wrote: > >  > Apr 26, 2022 20:32:55 Eric V. Smith : > >> How would runtime consumers of annotations use this? >> >> -- >> Eric >> >>>> On Apr 26, 2022, at 12:05 PM, Thomas K

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-26 Thread Eric V. Smith
How would runtime consumers of annotations use this? -- Eric > On Apr 26, 2022, at 12:05 PM, Thomas Kehrenberg wrote: > > If the problem is mostly type annotations, then another potential > solution would be to make use of .pyi files, which are not hamstrung by > circular definitions. The ide

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-25 Thread Eric V. Smith
On 4/25/2022 9:13 PM, Mehdi2277 wrote: We could have forward part include all of method signatures/attributes which is what a type checker needs. In theory we could do, forward class Foo: x: int y: list[str] def __init__(self, ...) def process(self, data: list[float]) -> float

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-25 Thread Eric V. Smith
On 4/25/2022 1:10 PM, Jim J. Jewett wrote: (That said, my personal opinion is that this is pretty heavyweight for very little gain; why not just create a placeholder class that static analysis tools are supposed to recognize as likely-to-be-replaced later? And why not just use strings giving

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-24 Thread Eric V. Smith
On 4/24/2022 5:42 AM, Stephen J. Turnbull wrote: What's the use case for arbitrary expressions vs. a (possibly qualified) name? A class factory that produces forward declarations? Do you have a use case in mind? It's: x.py: --8< forward class A() --8< x_impl.py

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-23 Thread Eric V. Smith
On 4/23/2022 9:55 AM, Jelle Zijlstra wrote: However, it doesn't solve the problem for base classes. For example, str is conceptually defined as `class str(Sequence["str"]):`. A forward reference can't make `str` defined when the bases are evaluated, because bases are resolved at the `forward

[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022-04-23 Thread Eric V. Smith
On 4/23/2022 3:28 AM, Tobias HT wrote: On the other hand, there's something I've been seeing around. I don't know if it was introduced by Mypy or something, but its the use of declaration files. I think they are saved as pyi files. They just have the declaration of a python object, be it cla

[Python-Dev] Re: Updating inspect APIs

2022-04-17 Thread Eric V. Smith
Things like os.stat_result use PyStructSequence_NewType, which is the C equivalent of a namedtuple. But a Struct Sequence has the extension of being able to have more named fields than the tuple length. It was designed, so I understand, just for cases like this. I don't know if it would be poss

[Python-Dev] Re: Importing a submodule doesn't always set an attribute on its parent

2022-04-09 Thread Eric V. Smith
On 4/9/2022 4:28 PM, Terry Reedy wrote: On 4/9/2022 5:09 AM, Arfrever Frehtes Taifersar Arahesis wrote: Not only deletion, but also random assignments: Ok.  Change "Manual deletion of entries from sys.modules" to "Direct manipulation of sys.modules" I'm not sure it's worth the hassle to do

[Python-Dev] Re: Are "Batteries Included" still a Good Thing? [was: It's now time to deprecate the stdlib urllib module]

2022-03-29 Thread Eric V. Smith
On 3/29/2022 4:55 PM, Skip Montanaro wrote: I was trying to think through how a "remote" stdlib might work. In the process, I got to wondering if there are known "specialists" for various current modules. Every now and then I still get assigned (or at least made nosy) about something to do with

[Python-Dev] Re: Changing unittest verbose output.

2022-03-27 Thread Eric V. Smith
> On Mar 27, 2022, at 11:20 AM, Eric V. Smith wrote: > >  > On 3/27/2022 10:51 AM, Jelle Zijlstra wrote: >> >> >> El sáb, 26 mar 2022 a las 17:51, Itay Yeshaya () >> escribió: >>> >>> Any thoughts on the mentioned solutions? >>

[Python-Dev] Re: Changing unittest verbose output.

2022-03-27 Thread Eric V. Smith
On 3/27/2022 10:51 AM, Jelle Zijlstra wrote: El sáb, 26 mar 2022 a las 17:51, Itay Yeshaya () escribió: Any thoughts on the mentioned solutions? This is a bit more out there, but can anyone explain why we show the docstring at all? As far as I can tell it causes a bunch of confusion

[Python-Dev] Re: Restrict the type of __slots__

2022-03-18 Thread Eric V. Smith
On 3/18/2022 4:58 PM, Guido van Rossum wrote: On Fri, Mar 18, 2022 at 9:40 AM Paul Bryan wrote: On Fri, 2022-03-18 at 09:35 -0700, Guido van Rossum wrote: The motivation has been explained already. In this thread? Yes, Eric's message. What on earth did your test do that g

[Python-Dev] Re: Restrict the type of __slots__

2022-03-18 Thread Eric V. Smith
On 3/18/2022 10:01 AM, Ronald Oussoren via Python-Dev wrote: On 18 Mar 2022, at 14:37, Joao S. O. Bueno wrote: IMO this is a purism that have little, if any place in language restrictions. I see that not allowing. "run once" iterables could indeed void attempts to write "deliberatly non co

[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 ___

[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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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=

[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 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: 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: 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] 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: 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] 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-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-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: 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: 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: 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: 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-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] 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: 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] 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: 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: 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: 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: 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-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 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
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: 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: 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: 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: 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: 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: 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: 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: NamedTemporaryFile and context managers

2021-04-08 Thread Eric V. Smith
On 4/8/2021 4:43 PM, Antoine Pitrou wrote: On Thu, 8 Apr 2021 13:31:26 -0700 Ethan Furman wrote: ```python from tempfile import NamedTemporaryFile with NamedTemporaryFile() as fp: fp.write(b'some data') fp.close() # Windows workaround fp.open() data = fp.read() assert

[Python-Dev] Re: Merge Request Review Reminder

2021-03-22 Thread Eric V. Smith
thon.org To unsubscribe send an email to python-dev-le...@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/LPCY3R4WINI5XCMWGPDA3EI52HMCPJTS/ Code of Conduct: http://python.org/p

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-10 Thread Eric V. Smith
On 2/10/2021 10:29 AM, Paul Moore wrote: On Wed, 10 Feb 2021 at 14:33, Anders Munch wrote: The idea is to make is so that working code only needs to change once, even when supporting multiple Python versions. That one change is to add either an explicit encoding=None (for backwards-compatibi

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

2021-01-11 Thread Eric V. Smith
On 1/11/2021 1:10 PM, Larry Hastings wrote: Certainly.  I'm just another victim in the copy-and-paste wars. I actually have write access to the PEPs repo (I'm a former release manager) so I'd be happy to check it in myself once it gets a number, however that happens.  Before I do so I'll stu

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread Eric V. Smith
On 11/23/2020 4:49 PM, David Mertz wrote: On Mon, Nov 23, 2020, 4:32 PM Eric V. Smith I just commented on Steve's post over on Discourse. The problem with this is that the called function (m.case, here) needs to have access to the caller's namespace in order to r

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread Eric V. Smith
On 11/23/2020 3:44 PM, David Mertz wrote: I have a little bit of skepticism about the pattern matching syntax, for similar reasons to those Larry expresses, and that Steve Dower mentioned on Discourse. Basically, I agree matching/destructuring is a powerful idea.  But I also wonder how much

[Python-Dev] Re: Advantages of pattern matching - a simple comparative analysis

2020-11-23 Thread Eric V. Smith
On 11/23/2020 5:44 PM, David Mertz wrote: I'd put the question this way: assuming Matcher can be written (with a bit of stack magic), and assuming that the strings inside m.case() calls are exactly the same mini-languague PEP 634 proposes, would you want a syntax change? N

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Eric V. Smith
On 11/2/2020 9:31 AM, Thomas Wouters wrote: On Sat, Oct 31, 2020 at 12:25 PM Steven D'Aprano > wrote: I really don't get why so many people are hung up over this minuscule issue of giving `_` special meaning inside match statements. IMO, consistency wi

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-18 Thread Eric V. Smith
On 10/18/2020 12:25 PM, Rob Cliffe via Python-Dev wrote: How do I do that, please?  I can't see an obvious create option on that web page.  Do I need to log in? Yes, you need to log in before you can open an issue. You might need to create an account first if you don't have one: it's called "R

[Python-Dev] Re: Shutting down Import-SIG mailing list?

2020-10-13 Thread Eric V. Smith
the list down, retaining the archives read-only for posterity. -Barry > On Oct 13, 2020, at 09:26, Eric V. Smith mailto:e...@trueblade.com>> wrote: > > Would anyone care if Import-SIG was shut down? It gets a few spam emails per day that need to be cleaned u

[Python-Dev] Shutting down Import-SIG mailing list?

2020-10-13 Thread Eric V. Smith
Would anyone care if Import-SIG was shut down? It gets a few spam emails per day that need to be cleaned up. It hasn't had any real messages for a couple of years. I think if the discussions were moved to python-dev it wouldn't be a noticeable increase in traffic. We'd want to keep it around f

[Python-Dev] Re: Farewell, Python 3.5

2020-10-01 Thread Eric V. Smith
Thanks for all of your work, Larry. I really think it was the stability of these releases that helped push 3.x into dominance over 2.7. 3  version control systems. Insane! Eric On 10/1/2020 1:49 PM, Larry Hastings wrote: At last!  Python 3.5 has now officially reached its end-of-life.  Sin

[Python-Dev] Re: Deferred, coalescing, and other very recent reference counting optimization

2020-09-02 Thread Eric V. Smith
On 9/2/2020 1:23 PM, Raihan Rasheed Apurbo wrote: Thank you, sir. Guido already mentioned it so I was going to search google about it. Thanks for your direct link as well. I really appreciate it. I will surely look into that. :) No problem. It would also help if you included a little contex

[Python-Dev] Re: Deferred, coalescing, and other very recent reference counting optimization

2020-09-01 Thread Eric V. Smith
Search for “Larry Hastings gilectomy”. For example, there’s this: https://speakerdeck.com/pycon2017/larry-hastings-the-gilectomy-hows-it-going -- Eric V. Smith (301) 502-0945 cell > On Sep 1, 2020, at 12:21 PM, Raihan Rasheed Apurbo wrote: > > Before experimenting can't I ask s

[Python-Dev] Re: Resurrecting PEP-472

2020-08-27 Thread Eric V. Smith
Leaving out the complication of needing a new sponsor, I would think the best course of action would be to create a new PEP. I think keeping the original rejected PEP is a net positive, and especially so if one of the original authors isn't available. At the very least, you'd want to remove the

[Python-Dev] Re: PR stuck in Travis

2020-08-21 Thread Eric V. Smith
Hi, Facundo. You could try closing the PR and then re-opening it. Eric On 8/21/2020 2:18 PM, Facundo Batista wrote: Hello! I want to land this PR: https://github.com/python/cpython/pull/21466 It's doc only, so it only run the docs part in GH actions. All fine, except Travis, which is "re

[Python-Dev] Re: Problems with python and Geany?

2020-07-16 Thread Eric V. Smith
This list is for the development of Python the language. For end-user help, you're better off using python-list, whose details are here: https://mail.python.org/mailman/listinfo/python-list Eric On 7/16/2020 8:00 AM, arajg...@sevenmentor.com wrote: So I have recently purchased a rapsberry pi

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-12 Thread Eric V. Smith
On 7/11/2020 7:54 PM, Greg Ewing wrote: I can see that being a reasonable choice if you're using 8-space indents, but I don't see that done much in Python. Also, directly translating this into Python leads to something that looks like a mistake:     match x:     case 1:     ...     case 2:

[Python-Dev] Re: ML help

2020-07-06 Thread Eric V. Smith
This list if for developing the next version of Python, not for providing help with using Python. I suggest you use a Sift-specific mailing list for help with Sift. Eric On 7/6/2020 4:54 AM, hamza naeem wrote: Hi , I am making a classifier which basically scans the historical places and detec

[Python-Dev] Re: Re Re: Recent PEP-8 change (Ivan Pozdeev)

2020-07-02 Thread Eric V. Smith
On 7/2/2020 6:49 PM, Rémi Lapeyre wrote: Le 3 juil. 2020 à 00:32, Ivan Pozdeev via Python-Dev mailto:python-dev@python.org>> a écrit : Athttps://git-scm.com/book/en/v2/Git-Branching-Rebasing#_rebase_vs_merge, they say that the argument of whether to allow overwriting history in VCSes stems

[Python-Dev] Re: PEP 620: Hide implementation details from the C API

2020-07-02 Thread Eric V. Smith
On 7/2/2020 11:36 AM, Stefan Behnel wrote: Victor Stinner schrieb am 02.07.20 um 00:07: Le mer. 1 juil. 2020 à 23:43, Eric V. Smith a écrit : On 7/1/2020 3:43 PM, Stefan Behnel wrote: Petr Viktorin schrieb am 30.06.20 um 14:51: For example, could we only deprecate the bad parts, but not

[Python-Dev] Re: PEP 620: Hide implementation details from the C API

2020-07-01 Thread Eric V. Smith
On 7/1/2020 3:43 PM, Stefan Behnel wrote: Petr Viktorin schrieb am 30.06.20 um 14:51: For example, could we only deprecate the bad parts, but not remove them until the experiments actually show that they are preventing a beneficial change? Big nod on this one. At one of the core sprints (mayb

[Python-Dev] Re: My take on multiple interpreters (Was: Should we be making so many changes in pursuit of PEP 554?)

2020-06-17 Thread Eric V. Smith
On 6/17/2020 6:03 PM, Jeff Allen wrote: On 17/06/2020 19:28, Eric V. Smith wrote: On 6/17/2020 12:07 PM, Jeff Allen wrote: If (1) interpreters manage the life-cycle of objects, and (2) a race condition arises when the life-cycle or state of an object is accessed by the interpreter that did

[Python-Dev] Re: My take on multiple interpreters (Was: Should we be making so many changes in pursuit of PEP 554?)

2020-06-17 Thread Eric V. Smith
On 6/17/2020 12:07 PM, Jeff Allen wrote: On 12/06/2020 12:55, Eric V. Smith wrote: On 6/11/2020 6:59 AM, Mark Shannon wrote: Different interpreters need to operate in their own isolated address space, or there will be horrible race conditions. Regardless of whether that separation is done in

[Python-Dev] Re: My take on multiple interpreters (Was: Should we be making so many changes in pursuit of PEP 554?)

2020-06-12 Thread Eric V. Smith
On 6/11/2020 6:59 AM, Mark Shannon wrote: Hi Riccardo, On 10/06/2020 5:51 pm, Riccardo Ghetta wrote: Hi, as an user, the "lua use case" is right what I need at work. I realize that for python this is a niche case, and most users don't need any of this, but I hope it will useful to understand w

[Python-Dev] Re: My take on multiple interpreters (Was: Should we be making so many changes in pursuit of PEP 554?)

2020-06-10 Thread Eric V. Smith
On 6/10/2020 8:33 AM, Mark Shannon wrote: Hi Petr, On 09/06/2020 2:24 pm, Petr Viktorin wrote: On 2020-06-05 16:32, Mark Shannon wrote: Whether Python interpreters run sequentially or in parallel, having them work will enable a use case I would like to see: allowing me to call Python code fr

[Python-Dev] Re: Should we be making so many changes in pursuit of PEP 554?

2020-06-05 Thread Eric V. Smith
On 6/5/2020 11:11 AM, Edwin Zimmerman wrote: Advantages of the one-to-one model -- 1. It's less bug prone. It is much easier to reason about code working in a single address space. Most code assumes I'm curious where reasoning about address spaces comes into writ

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Eric V. Smith
ty. E.g. in psutil I have "TimeoutExpired", also providing a "seconds" attribute. Also I've probably never seen ETIME / ETIMEDOUT happening, whereas AFAIU the point PEP 3151 was to create mappings for the most common errnos. On Sun, May 24, 2020 at 6:48 PM Eric V. Smith &

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-25 Thread Eric V. Smith
On 5/25/2020 4:25 AM, Serhiy Storchaka wrote: 24.05.20 17:48, Eric V. Smith пише: Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT. http://man7.org/linux/man-pages/man3/errno.3.html says

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-24 Thread Eric V. Smith
nds like a natural fit, I'd just do it for 3.10. On Sun, May 24, 2020, 9:45 AM Eric V. Smith wrote: Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT. http://man7.org/linux/man-page

[Python-Dev] Map errno==ETIME to TimeoutError

2020-05-24 Thread Eric V. Smith
Does anyone have an opinion on https://bugs.python.org/issue39673? It maps ETIME to TimeoutError, in addition to the already existing ETIMEDOUT. http://man7.org/linux/man-pages/man3/errno.3.html says: *ETIME *Timer expired (POSIX.1 (XSI STREAMS option)). (POSIX.1

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread Eric V. Smith
I fear that my comment on some text in the PEP was lost amidst the voting, so I'm repeating it here. This will probably screw up some threading, but this is the oldest message I have to reply to. The PEP says "At most one additional item may be consumed from one of the iterators when compared

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread Eric V. Smith
On 5/15/2020 11:56 AM, Chris Angelico wrote: On Sat, May 16, 2020 at 1:54 AM Antoine Pitrou wrote: On Fri, 15 May 2020 10:46:25 -0400 David Mertz wrote: 1. +1 itertools.zip_strict function 2. +1 zip.strict(*args) 3. +1 zip(*args, mode='strict') # mode='shortest' by default 4. +0 zip(*args, s

[Python-Dev] Re: [RELEASE] Python 3.9.0a6 is now available for testing

2020-04-29 Thread Eric V. Smith
Hi, ro...@reportlab.com. That looks like a real error. Thanks for the detailed report. Can you open a ticket on bugs.python.org? Eric On 4/29/2020 10:34 AM, ro...@reportlab.com wrote: While testing 3.9a6 in the reportlab package I see this difference from 3.8.2; I built from source using th

[Python-Dev] Re: Adding a "call_once" decorator to functools

2020-04-29 Thread Eric V. Smith
On 4/29/2020 3:55 AM, Tom Forbes wrote: Hey Raymond, Thanks for your input here! A new method wouldn’t be worth adding purely for performance reasons then, but there is still an issue around semantics and locking. One thing I don't understand about the proposed @call_once (or whatever it's c

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

2020-04-20 Thread Eric V. Smith
Congratulations, Dennis! Not 10 minutes ago I was writing code that could have used this functionality. And I got it wrong on my first attempt! I'm looking forward to it in 3.9. Eric On 4/20/2020 2:26 PM, Victor Stinner wrote: Hi, The Python Steering Council accepts the PEP 616 "String met

[Python-Dev] Re: Providing fix for modulefinder.py regression on Windows

2020-04-12 Thread Eric V. Smith
On 4/12/2020 4:08 PM, Barry Scott wrote: On 11 Apr 2020, at 16:28, Barry Scott > wrote: modulefinder.py does not open source files in "rb" which prevents compile() from applying the encoding rules. snip *I have created the bpo, the pr and have the checks passi

  1   2   3   4   5   6   >