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

2020-06-16 Thread Guido van Rossum
e 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-they-as-a-singul

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

2020-06-16 Thread Guido van Rossum
n-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/codeofconduct/ > -- --Gu

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

2020-06-14 Thread Guido van Rossum
-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/ > -- --Guido van Ro

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

2020-06-12 Thread Guido van Rossum
ntaxError 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 2020 at 17:21,

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

2020-06-12 Thread Guido van Rossum
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-change-the-world

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

2020-06-10 Thread Guido van Rossum
ad, 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://feministing.com/2015/02/03/how-us

[Python-ideas] Bringing the print statement back

2020-06-09 Thread Guido van Rossum
;>> print "hello world" hello world >>> print "hello", input("Name:") Name:Guido hello Guido >>> print 1, 2, 3, sep=", " 1, 2, 3 >>> But wait, there's more! The same syntax will make it possible to call *any* function: >>&g

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

2020-06-08 Thread Guido van Rossum
n 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/him **(why is

[Python-ideas] Re: Python JIT Compilation Thoughts

2020-05-26 Thread Guido van Rossum
ge archived at >> https://mail.python.org/archives/list/python-ideas@python.org/message/JJQNOXOO57NPLPGS243VIW6O2I7DD4WH/ >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > ___ > Python-ideas mailing list -- python-ideas@pytho

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

[Python-ideas] Re: Function composition

2020-05-24 Thread Guido van Rossum
g(f(x)). The professor starts by showing f(x), and then shows how you can apply g() to the result, and lo, you have defined g*f. (I'm sorry, I refuse to learn how to type the symbol they actually use. :-) On Sun, May 24, 2020 at 2:17 PM Tim Peters wrote: > [Guido] > >> I’ve never bee

[Python-ideas] Re: Function composition

2020-05-24 Thread Guido van Rossum
t;% group_by(Species) %>% summarize_if(is.numeric, mean) %>% >> ungroup() %>% gather(measure, value, -Species) %>% arrange(value) >> >> >> It's not abstract composition since it always starts with a concrete >> object the several operations work on. Bu

[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
wouldn't try patching it for *all* tests though -- there are many tests that might fail due to such a change. It also wouldn't help for file operations made directly from C code. --Guido On Thu, May 21, 2020 at 6:57 AM Steve Barnes wrote: > The issue is simple and simple enough for a beginner to f

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

2020-05-20 Thread Guido van Rossum
e 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/HM43KBNXA6ZJ66N7WPRZXIKQ372DTXVZ/ > Code of Conduct: http://python.o

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

2020-05-18 Thread Guido van Rossum
ibe 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/FCKRN42DTGJH3WLJLIT72DSPOHNYPZSS/ > 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
nd 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/psf/co

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

2020-05-16 Thread Guido van Rossum
turn type* of a function. This is because static checkers have a hard time with such APIs. (Almost-example: open(..., "rb") returns an IO[bytes] while open(..., "r") returns an IO[str].) PS. Why wasn't a new builtin zip_strict() on the menu? I think I would have given it at l

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

2020-05-13 Thread Guido van Rossum
/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 Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here

[Python-ideas] Re: General methods

2020-05-08 Thread Guido van Rossum
at 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?)* <http://

[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-ideas] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-03 Thread Guido van Rossum
elopment > - 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.python.org/mailman3/lists/python-ideas.p

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

2020-05-02 Thread Guido van Rossum
Okay, that's fair. So the argument really comes down to backwards compatibility (which is inconvenient but important). On Sat, May 2, 2020 at 1:51 PM Dominik Vilsmeier wrote: > `frozenset` and `set` make a counterexample: > > >>> frozenset({1}) == {1} > True > On 0

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

2020-05-02 Thread Guido van Rossum
3/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/ > -- --Guido van Rossum (python.org/~guido) *

[Python-ideas] Re: is a

2020-05-01 Thread Guido van Rossum
programmer is familiar with that tradition. (Maybe there's a traditional "round" operator in some field of math commonly practiced by numpy users that I've never heard of?) --Guido On Fri, May 1, 2020 at 7:42 PM Andrew Barnert via Python-ideas < python-ideas@python.org> wrote: > On

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

2020-04-26 Thread Guido van Rossum
lman3/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) *Pronouns: he/him **(why i

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

2020-04-08 Thread Guido van Rossum
nsue 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: Live variable analysis -> earlier release?

2020-04-08 Thread Guido van Rossum
y (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 list -- python-idea

[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

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

2020-03-30 Thread Guido van Rossum
s 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't have needed it. -

[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: Instance method to test equivalence between set and iterable

2020-03-22 Thread Guido van Rossum
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-ide

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

2020-03-22 Thread Guido van Rossum
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 or suffix. -- --Guid

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

2020-03-15 Thread Guido van Rossum
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/OQPPJ7SNM5CZUI5RYT5R4Z6YZ

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

2020-03-14 Thread Guido van Rossum
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 them and other > t

[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

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

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

2020-03-11 Thread Guido van Rossum
.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/7VCQ6MZPC7MRX4FFPAG7X4AIAD7AP4SU/ > Code of C

[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: New explicit methods to trim strings

2020-03-07 Thread Guido van Rossum
se): > ... > 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 with using stripprefix and s

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

2020-03-06 Thread Guido van Rossum
'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 be automatically added to bytes. >>>

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

2020-03-06 Thread Guido van Rossum
ist/python-ideas@python.org/message/I2PNEQFRKMBZNOBB4BNXEAASFPQ4727F/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido (mobile) ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-idea

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

2020-03-06 Thread Guido van Rossum
sts/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 **(why is

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

2020-03-06 Thread Guido van Rossum
hrisA > ___ > 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.py

[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: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-03 Thread Guido van Rossum
gt; 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/7WC4SF2GYVLP56K6Q74OKFPJGHGWAPIP/ > Code of Conduct

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

2020-03-02 Thread Guido van Rossum
, 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 can’t see how it can be >> retrofitted usefully into Python. >> >> >> This might well be true! I

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

2020-02-26 Thread Guido van Rossum
> 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. -- --Guido van Rossum (python.o

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

2020-02-24 Thread Guido van Rossum
nd 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/how-using-they-a

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

2020-02-24 Thread Guido van Rossum
ritten y = x1 + x2 + e) that, given the asserted relationship and some > assumptions, we can use to find the mathematical relationship between the > variables. > > I think our biggest concern is, what Guido earlier alluded to here, is, is > the operator precedence correct? In R (and Pat

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

2020-02-24 Thread Guido van Rossum
MWG7KM5O42TVVK3GUUXFZTB6LYUROQ/ > 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-23 Thread Guido van Rossum
il.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 (python.org/~guido) *Pronouns: he/

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

2020-02-23 Thread Guido van Rossum
uot; isn't enough. Is there an existing function in one of the libraries you mention that has the desired behavior (in the context of that library)? That would help. --Guido On Sun, Feb 23, 2020 at 4:58 PM Aaron Hall via Python-ideas < python-ideas@python.org> wrote: > Guido, thank you so

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

2020-02-23 Thread Guido van Rossum
se in R. > > -- > Brendan Barnwell > "Do not follow where the path may lead. Go, instead, where there is no > path, and leave a trail." > --author unknown > _______ > Python-ideas mailing list -- python-ideas@python.org &

[Python-ideas] Re: PYTHONLOGGING env variable

2020-02-20 Thread Guido van Rossum
eas 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/LXLSYU

[Python-ideas] Re: Add Binary module.

2020-02-20 Thread Guido van Rossum
is thread. -- --Guido (mobile) ___ 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/arch

[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 a __valid_getitem_requests__ protocol

2020-02-18 Thread Guido van Rossum
fferently: 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 previously. -- --Guido van Rossum (py

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Guido van Rossum
rt 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/~guido) *Pronouns: he/him **(why is my pronoun here?)* <

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Guido van Rossum
ython.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) *Pronouns: h

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

2020-02-18 Thread Guido van Rossum
ython-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-the-

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

2020-02-18 Thread Guido van Rossum
man3/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/~guido

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

2020-02-17 Thread Guido van Rossum
rg > 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/APZRZPV5YPBQ7TOERXFODISMUII2MOUL/ > Code of Conduct: http://p

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

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

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

2020-02-16 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/U5AOBMMGIANXFJEKMZYMWNQSY7D6RPL5/ > Code of Conduct: h

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

2020-02-15 Thread Guido van Rossum
hat 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. > Excellent! > > On Sat, Feb 15, 2020 at 10:16 PM Guido van Rossum

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

2020-02-15 Thread Guido van Rossum
t;> 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) but not >> adding or changing anything else. >> >> >

[Python-ideas] Re: Global thread executor

2020-02-15 Thread Guido van Rossum
l.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/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/h

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

2020-02-15 Thread Guido van Rossum
y 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 Tennodai 1-1-1, Tsukuba 305-8573 JAPAN > ___ >

[Python-ideas] Re: Asyncio Future.set_result_threadsafe

2020-02-12 Thread Guido van Rossum
s-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/ > -- --Guido van Ro

[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: Really long ints

2020-02-04 Thread Guido van Rossum
uestion:) 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 pronoun h

[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: allow full expressions in decorators

2020-02-04 Thread Guido van Rossum
n.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://feministing.com/2015/02/

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

2020-02-04 Thread Guido van Rossum
org/message/HNNHXVJ2BYEBXAUTUNPIQZVJP222ZLXV/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido (mobile) ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.py

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

2020-02-03 Thread Guido van Rossum
st -- 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/WOWD4P323DYDIGUQVWMESDWUG6QOW4MP/ &

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

2020-02-02 Thread Guido van Rossum
ibrary/concurrent.futures.html#concurrent.futures.Executor.shutdown > > For implementation details, see the PR: > https://github.com/python/cpython/pull/18057 > > Also, thank you Guido for bringing attention to the issue. The > implementation was a bit more involved than I initially anticipated >

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

2020-02-02 Thread Guido van Rossum
, where I feel it's fair to tell the participants to stop or take it elsewhere. On Sun, Feb 2, 2020 at 01:39 Johan Vergeer wrote: > Hi Guido, > > This thread had a lot of comments so far, both people that are pro and > con. > To be honest, a lot of you are a smarter and more expe

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

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

2020-02-01 Thread Guido van Rossum
(objects, whatever) when we write >> Python, we bind names to values with the = operator. (And other namespace >> trickery). Some types of objects do have a __name__ attribute: classes, >> functions created with def. >> >> But that name is on

[Python-ideas] Re: List - append

2020-01-21 Thread Guido van Rossum
Well, mypy is often used primarily as a linter on steroids. Anyway, agreed with your point! On Tue, Jan 21, 2020 at 10:22 AM Andrew Barnert wrote: > On Jan 19, 2020, at 20:54, Guido van Rossum wrote: > > > > Actually, `bar = foo` is more likely to be detected by mypy, since i

[Python-ideas] Re: List - append

2020-01-19 Thread Guido van Rossum
On Sun, Jan 19, 2020 at 8:16 PM Andrew Barnert wrote: > On Jan 19, 2020, at 15:20, Guido van Rossum wrote: > > > On Sun, Jan 19, 2020 at 3:10 PM Tim Peters wrote: > >> [Guido, on Pythons before 1.0.2 always printing non-None expression >>

[Python-ideas] Re: List - append

2020-01-19 Thread Guido van Rossum
On Sun, Jan 19, 2020 at 3:10 PM Tim Peters wrote: > [Guido, on Pythons before 1.0.2 always printing non-None expression > statement results] > > Heh. That was such a misfeature that I had thoroughly suppressed any > > memory of its existence. -k indeed. :-) > > I prefer

[Python-ideas] Re: List - append

2020-01-19 Thread Guido van Rossum
Heh. That was such a misfeature that I had thoroughly suppressed any memory of its existence. -k indeed. :-) On Sun, Jan 19, 2020 at 1:33 PM Tim Peters wrote: > [Guido] > > Sounds like a hallucination or fabrication. > > Nope! Turns out my memory was right :-) > > >

[Python-ideas] Re: List - append

2020-01-19 Thread Guido van Rossum
alls, each > returning `self`, and so their output was littered with crap they > didn't want to see. They didn't want to prefix every computational > statement with, e.g., "ignore = ", so Guido stopped the magical > output. > > Perhaps surprisingly, few people

[Python-ideas] Re: List - append

2020-01-19 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/24YMTGYKCNFHS2JROYSNSP6MUPZAFUCV/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (pytho

[Python-ideas] Re: Allow relative seek on StringIO

2020-01-16 Thread Guido van Rossum
python.org/archives/list/python-ideas@python.org/message/SR5XTK7KDIHFT4KCHEV7XFGYFZ335TSQ/ > 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/201

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

2020-01-15 Thread Guido van Rossum
man3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/FGTSBGTXW63SSXFQBASLCTXAT4M6RGGN/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido (mobile) ___

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Guido van Rossum
parser architecture, keeping track of a lot more state, or > partially re-parsing things in the error handler. (If it were easy, Guido > would have done it back in 1.x.) > > But maybe there’s a way to heuristically detect that these problems are > _likely_ causes of the error (with

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

2020-01-03 Thread Guido van Rossum
OK, since the current behavior of shutdown() is "disallow submitting new futures and wait for all currently queued futures to be processed", we definitely need a new flag. It looks like you have a good handle on the code -- do you want to submit a PR to GitHub to add such a parameter? --

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

2020-01-03 Thread Guido van Rossum
to do this in shutdown() after it has set self._shutdown but before it waits for the worker threads. --Guido On Fri, Jan 3, 2020 at 10:10 AM Miguel Ángel Prosper < miguelangel.pros...@gmail.com> wrote: > > Having a way to clear the queue and then shutdown once existing jobs are >

[Python-ideas] Re: Target-and-expression lists and if-try

2020-01-01 Thread Guido van Rossum
, 2019 at 9:35 PM Guido van Rossum wrote: > There were match proposals in the past — have you looked those up? Maybe > they solve your problem without that syntax — or maybe they would benefit > from it. > > On Tue, Dec 31, 2019 at 19:20 Andrew Barnert via Python-ideas < > py

[Python-ideas] Re: Target-and-expression lists and if-try

2019-12-31 Thread Guido van Rossum
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/JHR55HOBZW35QFAAGBFOFCMQ

[Python-ideas] Re: Testing for NANs [was Re: Fix statistics.median()?]

2019-12-27 Thread Guido van Rossum
-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/VHC4GO37ZT2UEW6RSRF4ASMTVK52UQ6H/ >> Code of Conduct: http://python.org/psf/codeofconduct/ &g

[Python-ideas] Re: Throw a TypeError exception if using type annotations (type hints) & the passed arg or return value is the wrong type

2019-12-24 Thread Guido van Rossum
won't want to slow down computations with O(N) type checks. IIUC there are existing packages that expose decorators that do this, but I have never tried to use them. --Guido On Tue, Dec 24, 2019 at 6:37 AM Andrew T wrote: > This is a feature PHP has had since PHP7 and is what I use

[Python-ideas] Re: Add symlinks option at shutil.move parameters

2019-12-20 Thread Guido van Rossum
Well, I should have read the source instead of the docs. :-( Contrary to what I thought, move() always preserves symlinks. Let's stop second-guessing until the OP responds. On Fri, Dec 20, 2019 at 11:43 Random832 wrote: > On Thu, Dec 19, 2019, at 17:43, Guido van Rossum wrote: > > A q

[Python-ideas] Re: Add symlinks option at shutil.move parameters

2019-12-19 Thread Guido van Rossum
gt; 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@python.org/message/E5QTNJ

[Python-ideas] Re: Argumenting in favor of first()

2019-12-10 Thread Guido van Rossum
nderscore as well to actually use it.) > > But I think Python is more dependent on its package ecosystem than most of > those languages (despite being the one that advertises “batteries > included”), and I’m not sure that’s a bad thing here any more than anywhere > else. The set of usef

[Python-ideas] Re: Argumenting in favor of first()

2019-12-09 Thread Guido van Rossum
ng already (I should have kept it muted :-). On Mon, Dec 9, 2019 at 8:56 PM Tim Peters wrote: > [Guido] > > ... > > Similarly, there is already a spelling of first() (or close enough) that > raises: 1-arg next(). > > If 1-arg first() would also raise, it would fail

[Python-ideas] Re: Argumenting in favor of first()

2019-12-09 Thread Guido van Rossum
ment from a set -- it's not like the iteration order is a secret, and it's not called "lowest". The other schemes to get one item out of a set in O(1) time will return the same element, since the only sensible way to do it is to iterate and stop after one iteration. -- --Guido van Rossum (py

[Python-ideas] Re: Argumenting in favor of first()

2019-12-09 Thread Guido van Rossum
One more and then I'll let this go. On Mon, Dec 9, 2019 at 10:49 AM Andrew Barnert wrote: > On Dec 8, 2019, at 21:41, Guido van Rossum wrote: > > I do have to admit that I'm probably biased because I didn't recall 2-arg > next() myself until it was mentioned in this thread. > &

<    1   2   3   4   5   6   7   8   9   >