Re: [Python-Dev] Review request: issue 27350, compact ordered dict

2016-08-27 Thread Guido van Rossum
Hopefully some core dev(s) can work on this during the core sprint, which
is from Sept 5-9.

On Sat, Aug 27, 2016 at 7:59 PM, INADA Naoki  wrote:

> Last call.  There are only two weeks until 3.6 beta.
> Please review it if possible.
>
> On Tue, Aug 9, 2016 at 10:12 PM, INADA Naoki 
> wrote:
> > Hi, devs.
> >
> > I've implemented compact and ordered dictionary [1], which PyPy
> > implemented in 2015 [2].
> >
> > Since it is my first large patch, I would like to have enough time for
> > review cycle by Python 3.6 beta1.
> >
> > Could someone review it?
> >
> > [1] http://bugs.python.org/issue27350
> > [2] https://morepypy.blogspot.jp/2015/01/faster-more-memory-
> efficient-and-more.html
> >
> > --
> > INADA Naoki  
>
> --
> INADA Naoki  
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> guido%40python.org
>



-- 
--Guido van Rossum (python.org/~guido)
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Review request: issue 27350, compact ordered dict

2016-08-27 Thread INADA Naoki
Last call.  There are only two weeks until 3.6 beta.
Please review it if possible.

On Tue, Aug 9, 2016 at 10:12 PM, INADA Naoki  wrote:
> Hi, devs.
>
> I've implemented compact and ordered dictionary [1], which PyPy
> implemented in 2015 [2].
>
> Since it is my first large patch, I would like to have enough time for
> review cycle by Python 3.6 beta1.
>
> Could someone review it?
>
> [1] http://bugs.python.org/issue27350
> [2] 
> https://morepypy.blogspot.jp/2015/01/faster-more-memory-efficient-and-more.html
>
> --
> INADA Naoki  

-- 
INADA Naoki  
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] What do we do about bad slicing and possible crashes (issue 27867)

2016-08-27 Thread Terry Reedy
Slicing can be made to malfunction and even crash with an 'evil' 
__index__ method. https://bugs.python.org/issue27867


The crux of the problem is this: PySlice_GetIndicesEx
receives a slice object and a sequence length.  Calling __index__ on the 
start, stop, and step components can mutate the sequence and invalidate 
the length.  Adjusting the int values of start and stop according to an 
invalid length (in particular, one that is too long) will result in 
invalid results or a crash.


Possible actions -- very briefly.  For more see end of
https://bugs.python.org/issue27867?@ok_message=msg 273801
0. Do nothing.
1. Detect length change and raise.
2. Retrieve length after any possible changes and proceed as normal.

Possible implementation strategies for 1. and 2.
A. Change all functions that call PySlice_GetIndicesEx.
B. Add PySlice_GetIndicesEx2 (or ExEx?), which would receive *collection 
instead of length, so the length could be retrieved after the __index__ 
calls.  Change calls. Deprecate PySlice_GetIndicesEx.


Which of the 4 possible patches, if any, would be best?
I personally prefer 2B.

And what versions should be patched?

--
Terry Jan Reedy

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com