Author terry.reedy
Recipients mark.dickinson, serhiy.storchaka, tehybel, terry.reedy
Date 2016-08-30.20:40:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472589621.52.0.394188505293.issue27867@psf.upfronthosting.co.za>
In-reply-to
Content
I like this. Very nice.  What I understand is that callers that access PySlice_GetIndicesEx via the header file (included with Python.h) will see the function as a macro.  When the macro is expanded, the length expression will be evaluated after any __index__ calls.

This approach requires that the length expression calculate the length from the sequence, rather than being a length computer before the call. I checked and all of our users in /Objects pass some form of seq.get_size().  This approach also requires that the function be accessed via .h rather than directly as the function in the .c file.  If we go this way, should he PySlice_GetIndicesEx doc say something?

I reviewed the two new functions and am satisfied a) that they correctly separate converting None and non-ints to ints from adjusting start and stop as ints according to length and b) that the effect of the change in logic for the latter is to stop making unnecessary checks that must fail.
History
Date User Action Args
2016-08-30 20:40:21terry.reedysetrecipients: + terry.reedy, mark.dickinson, serhiy.storchaka, tehybel
2016-08-30 20:40:21terry.reedysetmessageid: <1472589621.52.0.394188505293.issue27867@psf.upfronthosting.co.za>
2016-08-30 20:40:21terry.reedylinkissue27867 messages
2016-08-30 20:40:21terry.reedycreate