@@ -359,6 +359,17 @@ Optimizations |
|
|
359 |
359 |
|
360 |
360 |
* :class:`uuid.UUID` now uses ``__slots__`` to reduce its memory footprint. |
361 |
361 |
|
|
362 |
+* Improved performance of :func:`operator.itemgetter` by 33%. Optimized |
|
363 |
+ argument handling and added a fast path for the common case of a single |
|
364 |
+ non-negative integer index into a tuple (which is the typical use case in |
|
365 |
+ the standard library). (Contributed by Raymond Hettinger in |
|
366 |
+:issue:`35664`.) |
|
367 |
+ |
|
368 |
+* Sped-up field lookups in :func:`collections.namedtuple`. They are now more |
|
369 |
+ than two times faster, making them the fastest form of instance variable |
|
370 |
+ lookup in Python. (Contributed by Raymond Hettinger, Pablo Galindo, and |
|
371 |
+ Serhiy Storchaka in :issue:`32492`.) |
|
372 |
+ |
362 |
373 |
* The :class:`list` constructor does not overallocate the internal item buffer |
363 |
374 |
if the input iterable has a known length (the input implements ``__len__``). |
364 |
375 |
This makes the created list 12% smaller on average. (Contributed by Pablo |