[Python-ideas] Re: addition of "nameof" operator

2020-02-01 Thread Guido van Rossum
The whole feature. On Sat, Feb 1, 2020 at 14:35 Greg Ewing wrote: > On 2/02/20 6:12 am, Guido van Rossum wrote: > > > Alex, this is not ever going to be added to Python, > > For clarity, are you rejecting the whole idea of a "nameof" feature, > or just byte

[Python-ideas] Re: addition of "nameof" operator

2020-02-02 Thread Guido van Rossum
That's based on my observation of how the discussion went. I have been participating in such discussions for 30 years now and I can usually tell how it will end long before most other participants. So I actually cringe when I see discussion go on beyond the point of usefulness. This is such a case,

[Python-ideas] Re: concurrent.futures cancel pending at Executor.shutdown

2020-02-02 Thread Guido van Rossum
32309), so it would certainly be beneficial >> for me to build some experience in working with the internals of the >> executors. I think implementing this small feature would be a good >> introduction. >> >> On Wed, Jan 15, 2020 at 5:37 PM Guido van Rossum >> wrote: &

[Python-ideas] Re: allow full expressions in decorators

2020-02-03 Thread Guido van Rossum
I’ve always resisted changing this, but it keeps coming up, and in other cases we don’t restrict the grammar (except when there are real ambiguities). So maybe the SC can accept a PRP for this? On Mon, Feb 3, 2020 at 15:47 Ben Avrahami wrote: > Hi all, decorators are a very powerful feature in p

[Python-ideas] Re: allow full expressions in decorators

2020-02-04 Thread Guido van Rossum
Yes, it requires a PEP -- note that I am not longer the decider, and none of the core devs will want to take responsibility for such a change of heart, so it has to go to the Steering Council. And the easiest way for that is a PEP. On Tue, Feb 4, 2020 at 02:04 Eric V. Smith wrote: > On 2/4/2020

[Python-ideas] Re: allow full expressions in decorators

2020-02-04 Thread Guido van Rossum
ps://mail.python.org/archives/list/python-ideas@python.org/message/UDU3YP5BMWB6H5DEPQRFFHCHE2YUAFEM/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministi

[Python-ideas] Re: Really long ints

2020-02-04 Thread Guido van Rossum
gt; > P = my_int_maker(29674495668685510550154174642905332730771991, > 79985304335099507553127683875317177019959423, > 8596428121188033664754218345562493168782883) > (Rhetorical question:) How could my_int_maker(1, 00, 23) return 10023? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him

[Python-ideas] Re: Really long ints

2020-02-04 Thread Guido van Rossum
cal question:) How could my_int_maker(1, 00, 23) return 10023? >> > > Sorry I haven't been on the list long: does "rhetorical question" mean the > same thing to the Dutch as to Americans? ;) > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my

[Python-ideas] Re: PEP 614: Relaxing Grammar Restrictions On Decorators

2020-02-11 Thread Guido van Rossum
Honestly I don't see why the PEP even needs to bring up the matrix multiply operator. There is no ambiguity, and there is no backwards compatibility issue. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-us

[Python-ideas] Re: Asyncio Future.set_result_threadsafe

2020-02-12 Thread Guido van Rossum
d an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/PLKYKFWM4EM7DHUHWOBDU2JSJM57X7GM/ > Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Re: Why I like the idea of traits [was: Traits]

2020-02-15 Thread Guido van Rossum
logs/viewpost.jsp?thread=246488 > > -- > Associate Professor Division of Policy and Planning Science > http://turnbull/sk.tsukuba.ac.jp/ Faculty of Systems and Information > Email: turnb...@sk.tsukuba.ac.jp University of Tsukuba > Tel: 029-853-5175

[Python-ideas] Re: Global thread executor

2020-02-15 Thread Guido van Rossum
; To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/HGTACGSP524AR4YKJ22LO44IUX2D7MFH/ > Code of Conduct: http://python.org/psf/

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-15 Thread Guido van Rossum
ry function >> is, does it even need to be in the stdlib? >> >> I may well be missing something that makes some of these choices >> necessary or desirable. But otherwise, I think we’d be better off adding a >> SerialExecutor (that works with the existing Future type as-is

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-15 Thread Guido van Rossum
LED, CANCELLED_AND_NOTIFIED, and FINISHED. > > Since that would actually be quite useful for debugging purposes (I had to > access ``future._state`` several times while testing the new > *cancel_futures*), I'd be willing to work on implementing something like > this. > Excellen

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-16 Thread Guido van Rossum
mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/U5AOBMMGIANXFJEKMZYMWNQSY7D

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-16 Thread Guido van Rossum
thon.org/ >> Message archived at >> https://mail.python.org/archives/list/python-ideas@python.org/message/7ZQE3IB4NR7ZPLLKWIY54PW3X5K6YWUF/ >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > ___ > Python-ideas mailing

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-17 Thread Guido van Rossum
n-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/APZRZPV5YPBQ7TOERXF

[Python-ideas] Re: Add __keys__ or __items__ protocol

2020-02-18 Thread Guido van Rossum
/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/A6QP5JMRFSFP2YP7CBQ7I3V4DBYX77L2/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~

[Python-ideas] Re: Add a way to execute code in the context of different frame

2020-02-18 Thread Guido van Rossum
ist/python-ideas@python.org/message/ETBOLQKHTZFH7ELNOJG3TWRAXCOGYX2D/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-th

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Guido van Rossum
https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/3W4UBUL6QTONUZN2XFSVAPVKZTHO62PU/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido)

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Guido van Rossum
c). You have started a large number of threads in a short amount of time, and most of them have generated little of use to the Python community. Please think about how you can contribute something more constructive. -- --Guido van Rossum (python.org/~gui

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Guido van Rossum
ce *iterating* over them behaves very differently: for a mapping, iteration yields keys, while for a sequence, it yields values. A legitimate question that comes up from time to time is actually how to *distinguish* between mappings and sequences -- se the other python-ideas thread that I mentioned

[Python-ideas] Re: Add a way to execute code in the context of different frame

2020-02-18 Thread Guido van Rossum
On Tue, Feb 18, 2020 at 11:09 AM Serhiy Storchaka wrote: > 18.02.20 20:13, Guido van Rossum пише: > > I am a little confused how you get from "there are extra frames in the > > traceback" to "modify exec() to run code in another frame". > > Sorry for s

[Python-ideas] Re: Add Binary module.

2020-02-20 Thread Guido van Rossum
On Thu, Feb 20, 2020 at 01:39 Steve Jorgensen wrote: > It seems to me that this could simply be a package on pypi rather than > being added to the Python standard library. > Sure. But the interesting part is how to design the API. I’ve seen a number of interesting ideas in this thread. -- --Guid

[Python-ideas] Re: PYTHONLOGGING env variable

2020-02-20 Thread Guido van Rossum
+1 On Thu, Feb 20, 2020 at 11:46 Alex Hall wrote: > Christopher Barker wrote: > > I think it’s a “Bad Idea” to use an environment variable — who knows what > > Python script may be running on a given system? > > But a standard command line argument to the interpreter could be useful. > > Can you

[Python-ideas] Re: Make ~ (tilde) a binary operator, e.g. __sim__(self, other)

2020-02-23 Thread Guido van Rossum
luation, the tilde operator gains > little, at least in terms of providing model-evaluation expressions like > those in R. > > -- > Brendan Barnwell > "Do not follow where the path may lead. Go, instead, where there is no > path, and leave a trail." > --author

[Python-ideas] Re: Make ~ (tilde) a binary operator, e.g. __sim__(self, other)

2020-02-23 Thread Guido van Rossum
ail to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/JCR2IJSFEUNWHBTYUYSK7ET26QL4OC2J/ > Code of Conduct: http://python.org/psf/codeofconduct/ >

[Python-ideas] Re: Make ~ (tilde) a binary operator, e.g. __sim__(self, other)

2020-02-23 Thread Guido van Rossum
...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/MZFA265UAJR46KDAGFZ7BWMRHG4RX77H/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (pyt

[Python-ideas] Re: Add logging to subprocess.Popen

2020-02-24 Thread Guido van Rossum
ge/S5MWG7KM5O42TVVK3GUUXFZTB6LYUROQ/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___

[Python-ideas] Re: Make ~ (tilde) a binary operator, e.g. __sim__(self, other)

2020-02-24 Thread Guido van Rossum
. > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.pyth

[Python-ideas] Re: Make ~ (tilde) a binary operator, e.g. __sim__(self, other)

2020-02-24 Thread Guido van Rossum
re some kind of translation of the OP's original example (Lottery ~ Literacy + Wealth + Region) to a lambda involving those words? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/h

[Python-ideas] Re: Add logging to subprocess.Popen

2020-02-26 Thread Guido van Rossum
library does have an > > extensive and growing list of audit events that are intended to assist > > with testing, logging and security monitoring. > > Thanks, It looks like an audit hook could work. > But understand that these are meant for a totally different purpose. --

[Python-ideas] Re: None should raise a new exception, NoneError

2020-03-02 Thread Guido van Rossum
ace some but not >> most uses of none-aware operators, and would be inaccurate even when they >> can be used, doesn’t seem very promising. >> >> All in all, this whole NoneError thing seems like it could be a useful >> design for a brand-new Python-like language, but I c

[Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-03 Thread Guido van Rossum
I think it’s usually called Orderable. It’s a useful concept in static type checking too (e.g. mypy), where we’d use it as an upper bound for type variables, if we had it. I guess to exclude sets you’d have to introduce TotalOrderable. On Tue, Mar 3, 2020 at 04:03 Steve Jorgensen wrote: > I have

[Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-03 Thread Guido van Rossum
On Tue, Mar 3, 2020 at 10:43 AM Steve Jorgensen wrote: > Guido van Rossum wrote: > > I think it’s usually called Orderable. It’s a useful concept in static > type > > checking too (e.g. mypy), where we’d use it as an upper bound for type > > variables, if we had it. I gue

[Python-ideas] Re: CSV Dictwriter - Handling escape characters

2020-03-06 Thread Guido van Rossum
EVERYONE, please don’t follow up on the meta discussion. What’s said is said. But this type of discussion never leads to anything useful, and often causes more bad blood. (Chris, next time I think it would be better if you sat on your hands. And ditto for everyone else who thinks to respond to an i

[Python-ideas] Re: New explicit methods to trim strings

2020-03-06 Thread Guido van Rossum
ailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/GRGAFIII3AX22K3N3KT7RB4DPBY3LPVG/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(

[Python-ideas] Re: New explicit methods to trim strings

2020-03-06 Thread Guido van Rossum
This will only need a PEP if the eventual proposal is controversial. :-) Someone (Andrew Barnert?) has claimed that another name, like cut or trim, would be too confusing. I’m not sure I agree. I think strip_prefix is more confusing, and stripstr or strstrip would unnecessarily cut off the option

[Python-ideas] Re: New explicit methods to trim strings

2020-03-06 Thread Guido van Rossum
gt;>> >>> > And I'm perfectly okay with bytes() not having those methods. ;-) >>> >>> If heavy users of bytes want these methods, they can request them >>> separately. There's no backwards compatibility requirement for new >>> string methods to

[Python-ideas] Re: New explicit methods to trim strings

2020-03-07 Thread Guido van Rossum
ing, /, required=False): > ... > Maybe. FWIW, I looked at what a few other languages offer, and found that in Go, they use Trim(s, chars) for our s.strip(chars), and they have separate TrimPrefix and TrimSuffix methods. That seems the best solution of the bunch, so I am now okay wit

[Python-ideas] Re: Mailman 3 monthly summaries broken for Python-ideas

2020-03-08 Thread Guido van Rossum
python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/KASGQXTIHOK3IGDIQCWGWKWALKHBHWLF/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun

[Python-ideas] Re: More appropriate behavior for the NotImplemented object

2020-03-11 Thread Guido van Rossum
Looks like NotImplemented is widely misunderstood. It should *ONLY* be returned from binary operator overloads, like __add__. On Wed, Mar 11, 2020 at 03:49 wrote: > Steven D'Aprano wrote: > > On Wed, Mar 11, 2020 at 09:42:15AM -, Steve Jorgensen wrote: > > > I realize this is probably someth

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-03-12 Thread Guido van Rossum
requires that the loop control variable retain the last value assigned to it. But in comprehensions it might work, since the comprehension control variable lives in an inner scope (at least if it's a simple variable). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pro

[Python-ideas] Re: Allow using the or operator to denote unions in type annotations

2020-03-13 Thread Guido van Rossum
I think we should try to get PEP 604 accepted, with the runtime option (a), since that's the way we've gone already. PEP 604 proposes the right syntax, and I think mostly the right semantics (one could quibble about whether isinstance()/issubclass() ought to accept unions). Unfortunately it does n

[Python-ideas] Re: Allow using the or operator to denote unions in type annotations

2020-03-14 Thread Guido van Rossum
themselves to do their > magic. > It seems a simple enough idea. But unless you are a current contributor to one of the existing static type checkers I don't think you have the context to know how disruptive this would be. > But that is also, unfortunately, pushing more work onto t

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-15 Thread Guido van Rossum
ailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/OQPPJ7SNM5

[Python-ideas] Re: New explicit methods to trim strings

2020-03-22 Thread Guido van Rossum
meter? >> >> The only ways to use this function without counting is remove 1 prefix >> or remove all. >> > Please, please. removeprefix/removesuffix do not need a count. The use case is quite different from that of replace. And they should only remove (at most) one prefix

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-22 Thread Guido van Rossum
he same set: >>> {1}.issubset({1}) True Or did I miss a wink? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___

[Python-ideas] Re: Instance method to test equivalence between set and iterable

2020-03-23 Thread Guido van Rossum
< is the strict subset operator. <= is subset. What more can I say? On Mon, Mar 23, 2020 at 02:01 Steven D'Aprano wrote: > On Sun, Mar 22, 2020 at 09:49:26PM -0700, Guido van Rossum wrote: > > On Sun, Mar 22, 2020 at 6:51 PM Steven D'Aprano > wrote: > > >

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-03-30 Thread Guido van Rossum
that is what it's optimized for. Also note that it only applies to use cases where the data does, indeed, fit in the process's memory somewhat easily -- else you should probably use a temporary file. If the filesystem were fast enough and temporary files were easier to use we wouldn&

[Python-ideas] Live variable analysis -> earlier release?

2020-04-08 Thread Guido van Rossum
ome useful places where we wouldn't even have thought of this idea, and we might see a modest memory saving for most programs. Can anyone tear this idea apart? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/h

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-08 Thread Guido van Rossum
requested explicitly (maybe just with -O). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-ideas mailing

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-08 Thread Guido van Rossum
uld ensue because destructors/finalizers are running *earlier* than expected. ;-) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> __

[Python-ideas] Re: Adding a "once" function to functools

2020-04-26 Thread Guido van Rossum
.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/5OR3LJO7LOL6SC4OOGKFIVNNH4KADBPG/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Prono

[Python-ideas] Re: is a

2020-05-01 Thread Guido van Rossum
> Of course maybe I’m just failing to imagine good examples. > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.o

[Python-ideas] Re: Equality between some of the indexed collections

2020-05-02 Thread Guido van Rossum
gt; https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/BMSP5BQP2UURBKV5LPLQXO6PZDP5PQGX/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Gui

[Python-ideas] Re: Equality between some of the indexed collections

2020-05-02 Thread Guido van Rossum
_ >> Python-ideas mailing list -- python-ideas@python.org >> To unsubscribe send an email to python-ideas-le...@python.org >> https://mail.python.org/mailman3/lists/python-ideas.python.org/ >> Message archived at >> https://mail.pytho

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

2020-05-03 Thread Guido van Rossum
nt > - Desktop GUI and Web Development > - wxPython, numpy, scipy, Cython > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.pytho

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-05-04 Thread Guido van Rossum
On Mon, May 4, 2020 at 10:03 Antoine Pitrou wrote: > Of course, that's why I originally suggested that `Dict[...]` should be > spelled `Dict(...)` instead. ...and we’d be hosed now with no path from Dict to dict. > -- --Guido (mobile) ___ Python-idea

[Python-ideas] Re: General methods

2020-05-08 Thread Guido van Rossum
we say that e.g. bytes.index(bytearray(...), b) works, we should document it in the stdlib docs, and other Python implementations will have to support this too. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* &

[Python-ideas] Re: Making asserts non-recoverable.

2020-05-13 Thread Guido van Rossum
hon-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/47GWSXEQZ5VCHJYULARYNAWLC72GQCVA/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van

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

2020-05-16 Thread Guido van Rossum
clean than zip(strict=True); an relegating it to itertools.zip_strict() makes it a lot less attractive. And (b) That rule is most important when the flag affects the *return type* of a function. This is because static checkers have a hard time with such APIs. (Almost-example: open(..., "rb"

[Python-ideas] Re: Formally deprecate urllib.request.urlretrieve() and urllib.request.urlcleanup()

2020-05-18 Thread Guido van Rossum
be send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/BVLC52RM23DNTSVCYGSG4QK6KYTTFABJ/ > Code of Conduct: http://python.org/p

[Python-ideas] Re: Formally deprecate urllib.request.urlretrieve() and urllib.request.urlcleanup()

2020-05-18 Thread Guido van Rossum
Well it’s always possible that you’ll get an answer saying these should not be deprecated. How can you be sure they were only kept for Py 2 compatibility? On Mon, May 18, 2020 at 15:15 wrote: > Thanks! > > I wasn't sure whether I was missing something as they were not deprecated > at the same ti

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

2020-05-20 Thread Guido van Rossum
No, it's because the message speaks English, not Python, and in English we count starting from one. Users would be very confused you counted from zero here, On Wed, May 20, 2020 at 02:24 Paul Moore wrote: > I suspect it's because zip() is actually a class constructor, so > argument zero is self.

[Python-ideas] Re: How to propose a change with tests where the failing test case (current behaviour) is bad or dangerous

2020-05-21 Thread Guido van Rossum
> Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@py

[Python-ideas] Re: Function composition

2020-05-24 Thread Guido van Rossum
I’ve never been able to remember whether (f@g)(x) means f(g(x)) or g(f(x)). That pretty much kills the idea for me. On Sun, May 24, 2020 at 11:10 Alex Hall wrote: > On Sun, May 24, 2020 at 6:56 PM David Mertz wrote: > >> On Sun, May 24, 2020 at 11:21 AM Steven D'Aprano >> wrote: >> >>> > But h

[Python-ideas] Re: Function composition

2020-05-24 Thread Guido van Rossum
first in every language that implements a > composition operator, and in mathematics. While that may be arbitrary, > it's easy to remember: (f@g)(x) "looks a heck of a lot more like" > f(g(x)) than g(f(x)) because the former leaves the identifiers in the > same order

[Python-ideas] Re: How to propose a change with tests where the failing test case (current behaviour) is bad or dangerous

2020-05-25 Thread Guido van Rossum
It's nice to fantasize about RAM disks, but the code in zipfile.py is begging for a simpler solution, just pass in a wrapper that overrides the write() method (you may have to make a few changes but you can develop and test this separately from the fix for your bug). -- --Guido van R

[Python-ideas] Re: Python JIT Compilation Thoughts

2020-05-26 Thread Guido van Rossum
There was also Pyston. https://blog.pyston.org/ On Tue, May 26, 2020 at 11:42 Brett Cannon wrote: > It was Unladen Swallow that used LLVM, but it was early on in LLVM's JIT > life and they unfortunately had to spend a bunch of time fixing LLVM which > ate up the time they had to do the experimen

[Python-ideas] Re: [Python-Dev] Making asyncio more thread-friendly

2020-06-08 Thread Guido van Rossum
-ideas) for advice on how to best structure your gradual migration within asyncio's current limitations, rather than trying to propose deep changes to the standard library. Sorry the news is not better, but you will be better off this way. -- --Guido van Rossum (python.org/~guido) *Pronouns: he

[Python-ideas] Bringing the print statement back

2020-06-09 Thread Guido van Rossum
;>> a = (len "abc") File "", line 1 a = (len "abc") ^ SyntaxError: invalid syntax >>> I think that strikes a reasonable balance between usability and reduced detection of common errors. I could also dial it back a bit, e.g. maybe it&

[Python-ideas] Re: Bringing the print statement back

2020-06-10 Thread Guido van Rossum
tart a new thread, so we can lay this one to rest.) All in all, it's clear that there's no future for this idea, and I will happily withdraw it. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feminist

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-06-12 Thread Guido van Rossum
he REPL would seem to have no choice but to print the returned value -- the REPL has no indication that it came from `del`. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c

[Python-ideas] Re: Make `del x` an expression evaluating to `x`

2020-06-12 Thread Guido van Rossum
being a SyntaxError in statement mode, it > would simply produce a different ast node: > > * `del x` -> `Delete(x)` (as `x := 0` -> SyntaxError) > * `(del x)` -> `Expr(DeleteExpr(x))` (as `(x := 0)` -> > `Expr(NamedExpr(...))`) > > Eric > > On Fri, 12 Jun

[Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted

2020-06-14 Thread Guido van Rossum
to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/RYMLY4IVTCTIXZRXQAVLBKO4ZQAEH3WG/ > Code of Conduct: http://python.org/psf/codeofconduct/ > --

[Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted

2020-06-16 Thread Guido van Rossum
be send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/CB7AS43PNVNVGCR4VLE3ML76UMMFMS2P/ > Code of Conduct: http://python.org/psf/codeo

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Guido van Rossum
gt; time and energy be better aimed at fixing the standard rather than > making Python's JSON encoder broken by default? > You're kidding, right? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-

[Python-ideas] Re: Permanent code objects (less memory, quicker load, less Unix Copy On Write)

2020-06-19 Thread Guido van Rossum
van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe s

[Python-ideas] Re: Permanent code objects (less memory, quicker load, less Unix Copy On Write)

2020-06-20 Thread Guido van Rossum
ng, it was shown that even on the platform with the fastest > locking primitive (Windows at the time) it slowed down single-threaded > execution nearly two-fold. > > Guido also referenced this write-up from Greg: > https://mail.python.org/pipermail/python-dev/2001-August/017099.ht

[Python-ideas] Re: Permanent code objects (less memory, quicker load, less Unix Copy On Write)

2020-06-21 Thread Guido van Rossum
On Sun, Jun 21, 2020 at 02:53 M.-A. Lemburg wrote: > On 21.06.2020 01:47, Guido van Rossum wrote: > > Hm, I remember Greg's free threading too, but that's not the idea I was > > trying to recall this time. There really was something about bytecode > > object

[Python-ideas] Re: Permanent code objects (less memory, quicker load, less Unix Copy On Write)

2020-06-22 Thread Guido van Rossum
I like where this is going. It would be nice if certain constants could also be loaded from RO memory. On Mon, Jun 22, 2020 at 00:16 Inada Naoki wrote: > On Mon, Jun 22, 2020 at 12:00 AM Guido van Rossum > wrote: > > > > > > I believe this was what Greg Stein's ide

[Python-ideas] Re: Proposal to introduce pattern matching syntax

2020-06-22 Thread Guido van Rossum
lementation currently stops at the first matching block it comes > to, not the best match out of all blocks. This is meant to make it easier > to understand the “flow” of the statement, but it might be preferable to > execute the block associated with the best match, though

[Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-26 Thread Guido van Rossum
Steven just likes an argument. Nobody has ever taken the idea of a standard for language in comments seriously. It Just doen come up. On Fri, Jun 26, 2020 at 18:35 Bernardo Sulzbach < berna...@bernardosulzbach.com> wrote: > On Fri, Jun 26, 2020 at 9:43 PM Steven D'Aprano > wrote: > >> I dislike

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-06-27 Thread Guido van Rossum
Please read PEP 505 before rehashing this old idea. On Sat, Jun 27, 2020 at 06:35 Daniel. wrote: > When I need to traverse nested dicts, is a common pattern to do > > somedict.get('foo', {}).get('bar', {}) > > But there is no such equivalent for arrays, wouldn't be nice if we can > follow > > so

[Python-ideas] Re: Escapes inside curly braces in f-strings

2020-06-30 Thread Guido van Rossum
On Mon, Jun 29, 2020 at 21:30 MRAB wrote: > On 2020-06-30 02:14, Steven D'Aprano wrote: > [snip] > > Counter-proposal: hex escapes allow optional curly brackets, similar to > > unicode name escapes. You could even allow spaces within the braces, for > > grouping: > > > > # Existing: > >

[Python-ideas] Re: Add __eq__ to colletions.abc.Sequence ?

2020-06-30 Thread Guido van Rossum
ists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/BZTYVERLYDWPMW2QKSMDWXRRL3DUBSDC/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is

[Python-ideas] Re: Add random.choice_iter for randomly selecting from an arbitrary iterable

2020-07-13 Thread Guido van Rossum
I think you all should get together and come up with a good implementation, and then petition Raymond Hettinger. Or maybe there is an existing open source 3rd party project that has code you can copy? I don’t recall if random has a C accelerator, but if it does, you should come up with C code as we

[Python-ideas] Re: Missing link to git repo on the “Source code” page

2020-07-16 Thread Guido van Rossum
Hello Hans, This list is more for ideas related to Python the language. For the website, each page on python.org has a link at the bottom to the tracker where you can submit requests for improvements and PRs for the website itself. —Guido On Thu, Jul 16, 2020 at 04:31 Hans Ginzel wrote: > >th

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Guido van Rossum
I think it’s a reasonable idea and encourage you to start working on a design for the API and then a PRP. It would help if someone looked into a prototype implementation as well (once a design has been settled on). On Thu, Jul 16, 2020 at 03:31 Steven D'Aprano wrote: > On Wed, Jul 15, 2020 at 11

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-18 Thread Guido van Rossum
Yes please. FWIW, IIRC the “bundle values in a single parameter” predates the demise of __getslice__. It probably was meant for dict keys primarily (no surprise there). The bundling would have been easier for the C API — __getitem__ is as old as Python there. On Sat, Jul 18, 2020 at 10:49 Steven

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-18 Thread Guido van Rossum
On Sat, Jul 18, 2020 at 9:11 PM Christopher Barker wrote: > > > On Sat, Jul 18, 2020 at 1:43 PM Guido van Rossum wrote: > >> Yes please. >> > > Yes to what, exactly? > > -CHB > > FWIW, IIRC the “bundle values in a single parameter” predates the demise

[Python-ideas] Re: isolating user allocations

2020-07-19 Thread Guido van Rossum
What purpose do you have in mind for making this distinction? Even if it could be done easily (which I doubt), why would this be useful? On Sun, Jul 19, 2020 at 19:01 wrote: > Hello, > > The API provided by PEP 445 makes it possible to intercept allocation > requests through hooks, but it seems

[Python-ideas] Re: New clause in FOR and WHILE instead of ELSE

2020-07-20 Thread Guido van Rossum
On Mon, Jul 20, 2020 at 03:22 Jonathan Fine wrote: > This is a continuation of my previous post to this thread. > > Python's FOR ... ELSE ... , Raymond Hettinger has told us, has origins in > some ideas of Don Knuth. > That’s news to me (both that it’s due to Knuth and that Raymond said so). I i

[Python-ideas] Re: New clause in FOR and WHILE instead of ELSE

2020-07-20 Thread Guido van Rossum
Also, let me be clear that this feature will never be added to the language. On Mon, Jul 20, 2020 at 07:36 Guido van Rossum wrote: > On Mon, Jul 20, 2020 at 03:22 Jonathan Fine wrote: > >> This is a continuation of my previous post to this thread. >> >> Python'

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Guido van Rossum
wers to 1 & 2--it's not being done because > people don't find it useful. The answer to 3 is most likely "no" due to the > costs, but it would be nice if someone could weigh in on this part. Maybe > there's some workaround. > If you were asking me to weigh in *n

[Python-ideas] Re: isolating user allocations

2020-07-20 Thread Guido van Rossum
t to synchronize interpreter > states. This design has been done before for C/C++ ( > https://people.cs.umass.edu/~emery/pubs/dthreads-sosp11.pdf), but for > different reasons. > > On Mon, Jul 20, 2020 at 8:16 PM Guido van Rossum wrote: > >> On Mon, Jul 20, 2020 at 4:09 PM We

[Python-ideas] Re: Simplifying functions syntax

2020-07-20 Thread Guido van Rossum
nd > answer a thousand questions "What's the difference between def and fun? > Which should I use?", doesn't make life easier for teachers. > > > -- > Steven > ___ > Python-ideas mailing list -- python-ideas@python.org >

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-21 Thread Guido van Rossum
You have to find a core dev who is willing to act as a Sponsor. I recommend asking Steven d’Aprano (but I do not know if he’s interested). Until then, hash out the precise spec for the idea here. Coming up with a solid motivation is also important. On Tue, Jul 21, 2020 at 01:15 Stefano Borini wro

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-07-21 Thread Guido van Rossum
I think this cannot just be considered a bug fix, and it seems somewhat fundamental (catching arbitrary exceptions is controversial), so I recommend finding a core dev to sponsor a PEP. (Or finding one who thinks it is obviously a bug and will approve a PR.) On Tue, Jul 21, 2020 at 04:43 Dominik V

<    1   2   3   4   5   6   7   8   9   10   >