On Mon, Sep 28, 2020 at 3:33 PM Christopher Barker wrote:
> As for using an empty tuple, thanks Guido for laying out the logic so
> succinctly, and it does make it pretty simple that only the one index case is
> special. Nevertheless, I think most folks expect the special case to be at
> the en
On Sun, Sep 27, 2020 at 1:51 PM David Mertz wrote:
> On Sun, Sep 27, 2020 at 10:41 AM Stefano Borini
> wrote:
>
>> I kept the tuple as the accepted option, but I am personally open to
>> NoIndex as well. I am not sure how the SC would take a non-hashable, new
>> constant to be
>> honest, for suc
On Sat, Sep 26, 2020 at 8:40 PM Steven D'Aprano wrote:
> On Sat, Sep 26, 2020 at 01:47:56PM -0300, Sebastian Kreft wrote:
>
> > In this fashion have you considering having keyword only indices, that is
> > to only allow either obj[1, 2] or obj[row=1, col=2] (if the class
> supports
> > it), and d
On Sun, Sep 27, 2020 at 4:29 AM Stefano Borini
wrote:
> ```
> >>> obj[**d] = "foo" # no kwd arguments provided here
> ```
> I committed yesterday the following proposal
>
> https://github.com/python/peps/pull/1622
>
> But to be honest I am not sure if we should disallow these two constructs
> ``
On 2020-09-27 21:47, David Mertz wrote:
On Sun, Sep 27, 2020 at 10:41 AM Stefano Borini
mailto:stefano.bor...@gmail.com>> wrote:
I kept the tuple as the accepted option, but I am personally open to
NoIndex as well. I am not sure how the SC would take a non-hashable,
new constant to
On Sun, Sep 27, 2020 at 10:41 AM Stefano Borini
wrote:
> I kept the tuple as the accepted option, but I am personally open to
> NoIndex as well. I am not sure how the SC would take a non-hashable, new
> constant to be
> honest, for such a specific use case.
>
My "vote" is for NoIndex. I suggest
None of the examples posted in use cases show combinations of position and
keyword indexing. This feels like an important example, and moreover
without it, the discussion of what sentinel to use is less motivated.
In discussions, I have mentioned two examples, e.g.
distances[4:7, 100:120, 30:
On Sun, 27 Sep 2020 at 12:28, Stefano Borini wrote:
> I am not sure. I am on the fence on many topics. There seem to be no
> clear solution on many of them, it boils down to taste and compromise.
> In any case, I listen to all proposals (although with a small delay).
> I am working on the sentinel
On Sat, Sep 26, 2020 at 22:57 Steven D'Aprano wrote:
> Christopher, with the greatest respect, it is really demoralising for me
> to explain this issue something like three, four, maybe five times now
> (I'm not going to go back and count), including this thread which is
> specifically about this
On Sun, 27 Sep 2020 at 06:27, Steven D'Aprano wrote:
> As far as speed and complexity goes, I do not understand the C
> implementation well enough to categorically dismiss your claims, but
> from everything I have seen, neither is true: this should not have any
> significant slowdown, and the incr
On Sun, 27 Sep 2020 at 05:06, Ricky Teachey wrote:
>>> obj[**d] = "foo" # no kwd arguments provided here
I committed yesterday the following proposal
https://github.com/python/peps/pull/1622
But to be honest I am not sure if we should disallow these two constructs
d[*()]
d[**{}]
as equivale
On Sun, Sep 27, 2020 at 12:43 AM Steven D'Aprano
wrote:
> On Sat, Sep 26, 2020 at 01:47:56PM -0300, Sebastian Kreft wrote:
>
> > In this fashion have you considering having keyword only indices, that is
> > to only allow either obj[1, 2] or obj[row=1, col=2] (if the class
> supports
> > it), and
On Sun, Sep 27, 2020 at 7:08 PM Steven D'Aprano wrote:
> 1. Fill in a default index with one of:
>
> a. None
> b. empty tuple ()
> c. NotImplemented
> d. a new, unhashable builtin Missing or NoIndex
>
> 1d. avoids any chance of that, but requires a new builtin;
>
An interesting and very good poin
On Sat, Sep 26, 2020 at 07:12:00PM -0400, Ricky Teachey wrote:
> Another inconsistency is that the case of keyword arguments only would bind
> the RHS value to the first positional argument, which is the index, and not
> the value. I think this is what Guido was referring to when he responded
> tal
On 27/09/20 7:10 pm, Steven D'Aprano wrote:
kw = get_keywords() # oops, this returns an empty dict
obj[**kw] = value
If an explicit d[] is going to be a compile-time error, maybe
anything that has the same effect at run time should be an
error too?
--
Greg
__
15 matches
Mail list logo