From e3744138623429a3161c3c684d320516564383a7 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Sun, 28 Oct 2018 20:48:04 +0000 Subject: [PATCH 1/3] Add exact allocation optimization to lists in What's New --- Doc/whatsnew/3.8.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 05b7d235cee8000..430322bbf27a48e 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -242,6 +242,11 @@ Optimizations Note that this means that instances can no longer be weak-referenced and that arbitrary attributes can no longer be added to them. +* The :class:`list` constructor does not overallocate the internal item buffer + if the input iterable has a known size (the input implements ``__len__``). + This makes the created list 12% smaller on average and it speeds the creation + of very large lists. (Contributed by Pablo Galindo in :issue:`33234`.) + Build and C API Changes ======================= From 764858a6d9537ba3b8a2f6b31d93086cd03a1cab Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Sun, 28 Oct 2018 21:00:20 +0000 Subject: [PATCH 2/3] fixup! Add exact allocation optimization to lists in What's New --- Doc/whatsnew/3.8.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 430322bbf27a48e..ef15efe4ea550d8 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -244,8 +244,8 @@ Optimizations * The :class:`list` constructor does not overallocate the internal item buffer if the input iterable has a known size (the input implements ``__len__``). - This makes the created list 12% smaller on average and it speeds the creation - of very large lists. (Contributed by Pablo Galindo in :issue:`33234`.) + This makes the created list 12% smaller on average. (Contributed by Pablo + Galindo in :issue:`33234`.) Build and C API Changes From 0075e0a9b1cd6dd4cf581586a3dcfac3293b15ef Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Sun, 28 Oct 2018 21:56:16 +0000 Subject: [PATCH 3/3] fixup! fixup! Add exact allocation optimization to lists in What's New --- Doc/whatsnew/3.8.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index ef15efe4ea550d8..758d32e6e55a438 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -243,7 +243,7 @@ Optimizations that arbitrary attributes can no longer be added to them. * The :class:`list` constructor does not overallocate the internal item buffer - if the input iterable has a known size (the input implements ``__len__``). + if the input iterable has a known length (the input implements ``__len__``). This makes the created list 12% smaller on average. (Contributed by Pablo Galindo in :issue:`33234`.)