https://github.com/python/cpython/commit/bc8cf07d8dbb4341955dc85d9b2bf273ec5852c7
commit: bc8cf07d8dbb4341955dc85d9b2bf273ec5852c7
branch: main
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-05-09T10:55:09+03:00
summary:

gh-149083: Convert `_initial_missing` for pure py `reduce` to `sentinel` 
(#149536)

files:
M Lib/functools.py

diff --git a/Lib/functools.py b/Lib/functools.py
index 73274b94ef37da..409b2c50478c40 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -232,7 +232,7 @@ def __ge__(self, other):
 ### reduce() sequence to a single item
 
################################################################################
 
-_initial_missing = object()
+_initial_missing = sentinel('_initial_missing')
 
 def reduce(function, sequence, /, initial=_initial_missing):
     """

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to