[Python-ideas] Re: An HTTP API to list versions of Python

2020-05-26 Thread Kyle Stanley
Assuming the release managers are on-board with the idea (since it would impact them the most), I'm +1. Overall, it seems like it would help significantly to reduce the total number of different locations to update during the release process once we get it fully configured. > It could become more

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread David Mertz
On Tue, May 26, 2020 at 8:30 PM Greg Ewing wrote: > "Did the user supply a value for this optional argument?" is > a simple and reasonable question to ask. It deserves to have a > simple and direct way of answering it that always works. > It does so very little that I would definitely not want

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Greg Ewing
On 27/05/20 7:36 am, Alex Hall wrote: the only benefit I'm seeing is being able to avoid typing `if obj is sentinel`. In fact it saves even less typing than other proposals since you still have to write `obj ?= value`. "Did the user supply a value for this optional argument?" is a simple and

[Python-ideas] An HTTP API to list versions of Python

2020-05-26 Thread Julien Palard via Python-ideas
We do not have a standard way to get (programatically) informations about Python versions, this leads to having to commit to numerous places during each releases, and some other places never get the information (like old docs, see [1]). Maybe we should provide an HTTP API listing Python

[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

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread MRAB
On 2020-05-26 20:22, Chris Angelico wrote: On Wed, May 27, 2020 at 5:19 AM Alex Hall wrote: On Tue, May 26, 2020 at 9:05 PM Chris Angelico wrote: And the "is this name bound" check would potentially have other value, too. Can you think of any examples? When you're looping, searching

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Alex Hall
On Tue, May 26, 2020 at 9:24 PM Chris Angelico wrote: > On Wed, May 27, 2020 at 5:19 AM Alex Hall wrote: > > > > On Tue, May 26, 2020 at 9:05 PM Chris Angelico wrote: > >> > >> And the "is this name bound" check would potentially > >> have other value, too. > > > > > > Can you think of any

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Chris Angelico
On Wed, May 27, 2020 at 5:19 AM Alex Hall wrote: > > On Tue, May 26, 2020 at 9:05 PM Chris Angelico wrote: >> >> And the "is this name bound" check would potentially >> have other value, too. > > > Can you think of any examples? When you're looping, searching for something, and then seeing if

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Alex Hall
On Tue, May 26, 2020 at 9:05 PM Chris Angelico wrote: > And the "is this name bound" check would potentially > have other value, too. > Can you think of any examples? ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Chris Angelico
On Wed, May 27, 2020 at 2:51 AM Steven D'Aprano wrote: > But doing otherwise, having Undef be *not an object* but a kinda ghost > in the interpreter, is a huge language change and I doubt it would be > worth it. > But is it a huge change? I thought so too, until Greg suggested a quite plausible

[Python-ideas] Re: Python JIT Compilation Thoughts

2020-05-26 Thread Brett Cannon
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 experiment. On Mon, May 25, 2020 at 2:36 PM Christopher Barker wrote: > On Mon, May 25, 2020 at 3:05 AM wrote:

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread David Mertz
On Tue, May 26, 2020 at 12:53 PM Steven D'Aprano wrote: > >>> len(Undef) > TypeError: len() takes exactly one argument (0 given) > > since len takes no default values. But if Undef is considered to be an > actual object, like any other object, we ought to get this: > JavaScript and R,

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread David Mertz
On Tue, May 26, 2020 at 12:02 PM Dominik Vilsmeier wrote: > The NumPy, deque, and lru_cache cases are all ones where None is a perfect >> sentinel and the hypothetical 'undef' syntax would have zero value. > > For both `deque` and `lru_cache` None is a sensible argument so it can't > act as a

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Steven D'Aprano
On Mon, May 25, 2020 at 08:54:52PM -0700, Christopher Barker wrote: > On Mon, May 25, 2020 at 6:37 PM Steven D'Aprano wrote: > > > > A NOT_SPECIFIED singleton in builtins would be pretty clear. > > > > > > Guido's time machine strikes again! We already have that "not specified" > > singleton

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Dominik Vilsmeier
On 26.05.20 14:10, David Mertz wrote: All of those uses, including those where you say otherwise, treat None as a sentinel. In the iter() case, the optional seconds argument is *called* 'sentinel'. Guido recently mentioned that he had forgotten the two argument form of iter(), which is indeed

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Dan Sommers
On Tuesday, May 26, 2020, at 08:10 -0400, David Mertz wrote: [...] > Well, ok functions.reduce() really does make it's own sentinel in > order to show NONE as a "plain value". So I'll grant that one case is > slightly helped by a hypothetical 'undef'. In Python, 'undef' makes me think of

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Chris Angelico
On Tue, May 26, 2020 at 10:14 PM David Mertz wrote: > > All of those uses, including those where you say otherwise, treat None as a > sentinel. In the iter() case, the optional seconds argument is *called* > 'sentinel'. Guido recently mentioned that he had forgotten the two argument > form of

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread David Mertz
All of those uses, including those where you say otherwise, treat None as a sentinel. In the iter() case, the optional seconds argument is *called* 'sentinel'. Guido recently mentioned that he had forgotten the two argument form of iter(), which is indeed funny... But useful. Well, ok

[Python-ideas] Re: Python GIL Thoughts

2020-05-26 Thread Rhodri James
On 26/05/2020 02:42, Steven D'Aprano wrote: On Mon, May 25, 2020 at 11:11:14AM -,redrad...@gmail.com wrote: We just need to provide two APIs: 1) Synchronized: `run`, `run_string`, that will wait until thread notify with setting `atomic variable` in true that it finished 2) Asynchronized

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread MRAB
On 2020-05-26 07:21, David Mertz wrote: You mean the sentinel is called 'undef'? With undef-coallescing operators? On Tue, May 26, 2020, 2:14 AM Greg Ewing > wrote: Wild idea: Instead of sentinels, have a way of declaring optional arguments with no

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Dominik Vilsmeier
On 26.05.20 06:03, David Mertz wrote: On Mon, May 25, 2020, 11:56 PM Christopher Barker well, yes and no. this conversation was in the context of "None" works fine most of the time. How many functions take None as a non-sentinel value?! How many of that tiny numbers do so only

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Chris Angelico
On Tue, May 26, 2020 at 4:25 PM David Mertz wrote: > > You mean the sentinel is called 'undef'? With undef-coallescing operators? > No, that would imply that it is a value. As I understand it, the sentinel is an *unbound local variable*. ChrisA ___

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread David Mertz
You mean the sentinel is called 'undef'? With undef-coallescing operators? On Tue, May 26, 2020, 2:14 AM Greg Ewing wrote: > Wild idea: Instead of sentinels, have a way of declaring optional > arguments with no default, and a way of conditionally assigning a > value to them if they are not

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Chris Angelico
On Tue, May 26, 2020 at 4:12 PM Greg Ewing wrote: > > Wild idea: Instead of sentinels, have a way of declaring optional > arguments with no default, and a way of conditionally assigning a > value to them if they are not bound. > > E.g. > > def order(eggs = 4, spam =): > spam ?=

[Python-ideas] Re: Optional keyword arguments

2020-05-26 Thread Greg Ewing
Wild idea: Instead of sentinels, have a way of declaring optional arguments with no default, and a way of conditionally assigning a value to them if they are not bound. E.g. def order(eggs = 4, spam =): spam ?= Spam() Here the '?=' means "if spam is not bound, then evaluate the rhs